home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Swift 3D 3D Graphic (poly/swift3D3DGraphic)
| ext
| Unsupported |
1%
| dexvert
| Boost Text serialization (other/boostTextSerialization)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| Mailbox text, 1st line "From terminator!umich!samsung!uunet!mcsun!unido!laura!heike!klute Mon May 14 14:07:18 EDT 1990"
| default
| |
99%
| file
| C source, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| x-fmt/111 Plain Text File
| default
| |
100%
| gt2
| Textdatei (UNIX)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| application/mbox
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 74 65 72 | 6d 69 6e 61 74 6f 72 21 |From ter|minator!|
|00000010| 75 6d 69 63 68 21 73 61 | 6d 73 75 6e 67 21 75 75 |umich!sa|msung!uu|
|00000020| 6e 65 74 21 6d 63 73 75 | 6e 21 75 6e 69 64 6f 21 |net!mcsu|n!unido!|
|00000030| 6c 61 75 72 61 21 68 65 | 69 6b 65 21 6b 6c 75 74 |laura!he|ike!klut|
|00000040| 65 20 4d 6f 6e 20 4d 61 | 79 20 31 34 20 31 34 3a |e Mon Ma|y 14 14:|
|00000050| 30 37 3a 31 38 20 45 44 | 54 20 31 39 39 30 0a 41 |07:18 ED|T 1990.A|
|00000060| 72 74 69 63 6c 65 20 32 | 33 38 33 35 20 6f 66 20 |rticle 2|3835 of |
|00000070| 63 6f 6d 70 2e 73 79 73 | 2e 61 74 61 72 69 2e 73 |comp.sys|.atari.s|
|00000080| 74 3a 0a 50 61 74 68 3a | 20 74 65 72 6d 69 6e 61 |t:.Path:| termina|
|00000090| 74 6f 72 21 75 6d 69 63 | 68 21 73 61 6d 73 75 6e |tor!umic|h!samsun|
|000000a0| 67 21 75 75 6e 65 74 21 | 6d 63 73 75 6e 21 75 6e |g!uunet!|mcsun!un|
|000000b0| 69 64 6f 21 6c 61 75 72 | 61 21 68 65 69 6b 65 21 |ido!laur|a!heike!|
|000000c0| 6b 6c 75 74 65 0a 3e 46 | 72 6f 6d 3a 20 6b 6c 75 |klute.>F|rom: klu|
|000000d0| 74 65 40 68 65 69 6b 65 | 2e 69 6e 66 6f 72 6d 61 |te@heike|.informa|
|000000e0| 74 69 6b 2e 75 6e 69 2d | 64 6f 72 74 6d 75 6e 64 |tik.uni-|dortmund|
|000000f0| 2e 64 65 20 28 52 61 69 | 6e 65 72 20 4b 6c 75 74 |.de (Rai|ner Klut|
|00000100| 65 29 0a 4e 65 77 73 67 | 72 6f 75 70 73 3a 20 63 |e).Newsg|roups: c|
|00000110| 6f 6d 70 2e 73 79 73 2e | 61 74 61 72 69 2e 73 74 |omp.sys.|atari.st|
|00000120| 0a 53 75 62 6a 65 63 74 | 3a 20 50 65 78 65 63 20 |.Subject|: Pexec |
|00000130| 43 6f 6f 6b 62 6f 6f 6b | 3a 20 48 65 72 65 20 69 |Cookbook|: Here i|
|00000140| 74 20 69 73 0a 4d 65 73 | 73 61 67 65 2d 49 44 3a |t is.Mes|sage-ID:|
|00000150| 20 3c 32 31 35 36 40 6c | 61 75 72 61 2e 55 55 43 | <2156@l|aura.UUC|
|00000160| 50 3e 0a 44 61 74 65 3a | 20 31 34 20 4d 61 79 20 |P>.Date:| 14 May |
|00000170| 39 30 20 30 36 3a 35 33 | 3a 35 37 20 47 4d 54 0a |90 06:53|:57 GMT.|
|00000180| 52 65 66 65 72 65 6e 63 | 65 73 3a 20 3c 41 31 34 |Referenc|es: <A14|
|00000190| 33 31 34 34 32 36 30 33 | 40 74 68 65 6c 61 6b 65 |31442603|@thelake|
|000001a0| 2e 6d 6e 2e 6f 72 67 3e | 0a 53 65 6e 64 65 72 3a |.mn.org>|.Sender:|
|000001b0| 20 6e 65 77 73 40 6c 61 | 75 72 61 2e 55 55 43 50 | news@la|ura.UUCP|
|000001c0| 0a 52 65 70 6c 79 2d 54 | 6f 3a 20 6b 6c 75 74 65 |.Reply-T|o: klute|
|000001d0| 40 68 65 69 6b 65 2e 69 | 6e 66 6f 72 6d 61 74 69 |@heike.i|nformati|
|000001e0| 6b 2e 75 6e 69 2d 64 6f | 72 74 6d 75 6e 64 2e 64 |k.uni-do|rtmund.d|
|000001f0| 65 20 28 52 61 69 6e 65 | 72 20 4b 6c 75 74 65 29 |e (Raine|r Klute)|
|00000200| 0a 4f 72 67 61 6e 69 7a | 61 74 69 6f 6e 3a 20 55 |.Organiz|ation: U|
|00000210| 6e 69 76 65 72 73 69 74 | 79 20 6f 66 20 44 6f 72 |niversit|y of Dor|
|00000220| 74 6d 75 6e 64 2c 20 46 | 52 47 0a 4c 69 6e 65 73 |tmund, F|RG.Lines|
|00000230| 3a 20 38 38 35 0a 0a 0a | 4d 61 6e 79 20 70 65 6f |: 885...|Many peo|
|00000240| 70 6c 65 20 61 73 6b 65 | 64 20 66 6f 72 20 74 68 |ple aske|d for th|
|00000250| 65 20 50 65 78 65 63 20 | 43 6f 6f 6b 62 6f 6f 6b |e Pexec |Cookbook|
|00000260| 20 6f 72 20 77 6f 6e 64 | 65 72 65 64 20 77 68 61 | or wond|ered wha|
|00000270| 74 20 69 74 20 77 61 73 | 2e 20 57 68 61 74 20 49 |t it was|. What I|
|00000280| 0a 68 61 76 65 20 61 6e | 64 20 70 6f 73 74 20 68 |.have an|d post h|
|00000290| 65 72 65 62 79 20 69 73 | 20 61 20 22 70 72 65 6c |ereby is| a "prel|
|000002a0| 69 6d 69 6e 61 72 79 20 | 76 65 72 73 69 6f 6e 20 |iminary |version |
|000002b0| 6f 66 20 74 68 65 20 6c | 6f 6e 67 2d 61 77 61 69 |of the l|ong-awai|
|000002c0| 74 65 64 20 50 65 78 65 | 63 0a 63 6f 6f 6b 62 6f |ted Pexe|c.cookbo|
|000002d0| 6f 6b 22 2e 20 49 74 20 | 77 61 73 20 70 6f 73 74 |ok". It |was post|
|000002e0| 65 64 20 61 6c 72 65 61 | 64 79 20 73 6f 6d 65 20 |ed alrea|dy some |
|000002f0| 74 69 6d 65 20 61 67 6f | 20 28 22 74 68 6f 73 65 |time ago| ("those|
|00000300| 20 67 6f 6f 64 20 6f 6c | 64 20 64 61 79 73 22 29 | good ol|d days")|
|00000310| 0a 62 79 20 41 6c 6c 61 | 6e 20 50 72 61 74 74 20 |.by Alla|n Pratt |
|00000320| 28 41 74 61 72 69 29 20 | 69 6e 20 74 68 69 73 20 |(Atari) |in this |
|00000330| 6e 65 77 73 67 72 6f 75 | 70 2e 20 49 20 64 6f 20 |newsgrou|p. I do |
|00000340| 6e 6f 74 20 6b 6e 6f 77 | 20 69 66 20 61 20 6e 65 |not know| if a ne|
|00000350| 77 65 72 0a 76 65 72 73 | 69 6f 6e 20 65 78 69 73 |wer.vers|ion exis|
|00000360| 74 73 2e 20 2d 20 41 70 | 70 65 6e 64 65 64 20 74 |ts. - Ap|pended t|
|00000370| 6f 20 74 68 65 20 50 65 | 78 65 63 20 43 6f 6f 6b |o the Pe|xec Cook|
|00000380| 62 6f 6f 6b 20 79 6f 75 | 20 77 69 6c 6c 20 66 69 |book you| will fi|
|00000390| 6e 64 20 73 6f 6d 65 20 | 6d 6f 72 65 0a 63 6f 6d |nd some |more.com|
|000003a0| 70 2e 73 79 73 2e 61 74 | 61 72 69 2e 73 74 20 61 |p.sys.at|ari.st a|
|000003b0| 72 74 69 63 6c 65 73 20 | 6f 6e 20 74 68 65 20 73 |rticles |on the s|
|000003c0| 75 62 6a 65 63 74 20 6f | 66 20 70 72 6f 67 72 61 |ubject o|f progra|
|000003d0| 6d 20 63 61 6c 6c 69 6e | 67 2e 20 48 6f 70 65 66 |m callin|g. Hopef|
|000003e0| 75 6c 6c 79 0a 79 6f 75 | 20 77 69 6c 6c 20 66 69 |ully.you| will fi|
|000003f0| 6e 64 20 73 6f 6d 65 20 | 75 73 65 66 75 6c 20 69 |nd some |useful i|
|00000400| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 74 68 65 72 65 |nformati|on there|
|00000410| 21 0a 0a 20 20 44 69 70 | 6c 2e 2d 49 6e 66 6f 72 |!.. Dip|l.-Infor|
|00000420| 6d 2e 20 52 61 69 6e 65 | 72 20 4b 6c 75 74 65 20 |m. Raine|r Klute |
|00000430| 20 20 20 20 20 6b 6c 75 | 74 65 40 68 65 69 6b 65 | klu|te@heike|
|00000440| 2e 69 6e 66 6f 72 6d 61 | 74 69 6b 2e 75 6e 69 2d |.informa|tik.uni-|
|00000450| 64 6f 72 74 6d 75 6e 64 | 2e 64 65 0a 20 20 55 6e |dortmund|.de. Un|
|00000460| 69 76 2e 20 44 6f 72 74 | 6d 75 6e 64 2c 20 49 52 |iv. Dort|mund, IR|
|00000470| 42 20 20 20 20 20 20 20 | 20 20 20 20 20 20 6b 6c |B | kl|
|00000480| 75 74 65 40 75 6e 69 64 | 6f 2e 75 75 63 70 2c 20 |ute@unid|o.uucp, |
|00000490| 6b 6c 75 74 65 40 75 6e | 69 64 6f 2e 62 69 74 6e |klute@un|ido.bitn|
|000004a0| 65 74 0a 20 20 50 6f 73 | 74 66 61 63 68 20 35 30 |et. Pos|tfach 50|
|000004b0| 30 35 30 30 20 20 20 20 | 20 20 20 20 20 7c 29 7c |0500 | |)||
|000004c0| 2f 20 20 20 20 2e 2e 2e | 75 75 6e 65 74 21 6d 63 |/ ...|uunet!mc|
|000004d0| 76 61 78 21 75 6e 69 64 | 6f 21 6b 6c 75 74 65 0a |vax!unid|o!klute.|
|000004e0| 44 2d 34 36 30 30 20 44 | 6f 72 74 6d 75 6e 64 20 |D-4600 D|ortmund |
|000004f0| 35 30 20 20 20 20 20 20 | 20 20 7c 5c 7c 5c 20 20 |50 | |\|\ |
|00000500| 20 20 54 65 6c 2e 3a 20 | 2b 34 39 20 32 33 31 20 | Tel.: |+49 231 |
|00000510| 37 35 35 2d 34 36 36 33 | 0a 0a 0a 3d 3d 3d 3d 3d |755-4663|...=====|
|00000520| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000530| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 20 73 |========|====== s|
|00000540| 6e 69 70 2c 20 73 6e 69 | 70 0a 3d 3d 3d 3d 3d 3d |nip, sni|p.======|
|00000550| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000560| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 0a 0a 0a |========|=====...|
|00000570| 41 6c 6c 61 6e 20 50 72 | 61 74 74 20 28 41 74 61 |Allan Pr|att (Ata|
|00000580| 72 69 29 20 6f 6e 20 74 | 68 65 20 73 75 62 6a 65 |ri) on t|he subje|
|00000590| 63 74 20 6f 66 20 50 65 | 78 65 63 3a 2d 0a 0a 54 |ct of Pe|xec:-..T|
|000005a0| 68 69 73 20 69 73 20 69 | 6e 20 72 65 73 70 6f 6e |his is i|n respon|
|000005b0| 73 65 20 74 6f 20 61 20 | 72 65 71 75 65 73 74 20 |se to a |request |
|000005c0| 66 72 6f 6d 20 43 68 72 | 69 73 74 69 61 6e 20 4b |from Chr|istian K|
|000005d0| 61 65 72 6e 62 61 63 68 | 20 77 68 69 63 68 20 49 |aernbach| which I|
|000005e0| 20 67 6f 74 0a 66 72 6f | 6d 20 20 42 49 54 4e 45 | got.fro|m BITNE|
|000005f0| 54 3a 20 49 20 63 61 6e | 27 74 20 72 65 70 6c 79 |T: I can|'t reply|
|00000600| 20 64 69 72 65 63 74 6c | 79 20 74 6f 20 42 49 54 | directl|y to BIT|
|00000610| 4e 45 54 2c 20 62 75 74 | 20 49 27 6d 20 73 75 72 |NET, but| I'm sur|
|00000620| 65 20 6f 74 68 65 72 20 | 70 65 6f 70 6c 65 0a 77 |e other |people.w|
|00000630| 69 6c 6c 20 66 69 6e 64 | 20 74 68 69 73 20 69 6e |ill find| this in|
|00000640| 74 65 72 65 73 74 69 6e | 67 2c 20 74 6f 6f 3a 20 |terestin|g, too: |
|00000650| 69 74 27 73 20 61 20 70 | 72 65 6c 69 6d 69 6e 61 |it's a p|relimina|
|00000660| 72 79 20 76 65 72 73 69 | 6f 6e 20 6f 66 20 74 68 |ry versi|on of th|
|00000670| 65 0a 6c 6f 6e 67 2d 61 | 77 61 69 74 65 64 20 50 |e.long-a|waited P|
|00000680| 65 78 65 63 20 63 6f 6f | 6b 62 6f 6f 6b 21 0a 0a |exec coo|kbook!..|
|00000690| 49 6e 20 62 72 6f 61 64 | 20 74 65 72 6d 73 2c 20 |In broad| terms, |
|000006a0| 74 68 65 20 74 68 69 6e | 67 73 20 79 6f 75 20 68 |the thin|gs you h|
|000006b0| 61 76 65 20 74 6f 20 6b | 6e 6f 77 20 61 62 6f 75 |ave to k|now abou|
|000006c0| 74 20 50 65 78 65 63 20 | 61 72 65 20 74 68 61 74 |t Pexec |are that|
|000006d0| 20 69 74 0a 73 74 61 72 | 74 73 20 75 70 20 61 20 | it.star|ts up a |
|000006e0| 70 72 6f 63 65 73 73 2c | 20 6c 65 74 73 20 69 74 |process,| lets it|
|000006f0| 20 65 78 65 63 75 74 65 | 2c 20 74 68 65 6e 20 72 | execute|, then r|
|00000700| 65 74 75 72 6e 73 20 74 | 6f 20 74 68 65 20 63 61 |eturns t|o the ca|
|00000710| 6c 6c 65 72 0a 77 68 65 | 6e 20 74 68 61 74 20 70 |ller.whe|n that p|
|00000720| 72 6f 63 65 73 73 20 74 | 65 72 6d 69 6e 61 74 65 |rocess t|erminate|
|00000730| 73 2e 20 20 54 68 65 20 | 22 63 61 6c 6c 65 72 22 |s. The |"caller"|
|00000740| 20 2d 2d 20 74 68 65 20 | 70 72 6f 63 65 73 73 20 | -- the |process |
|00000750| 77 68 69 63 68 20 75 73 | 65 64 20 50 65 78 65 63 |which us|ed Pexec|
|00000760| 0a 69 6e 20 74 68 65 20 | 66 69 72 73 74 20 70 6c |.in the |first pl|
|00000770| 61 63 65 20 2d 2d 20 68 | 61 73 20 73 6f 6d 65 20 |ace -- h|as some |
|00000780| 72 65 73 70 6f 6e 73 69 | 62 69 6c 69 74 69 65 73 |responsi|bilities|
|00000790| 3a 20 69 74 20 68 61 73 | 20 74 6f 20 6d 61 6b 65 |: it has| to make|
|000007a0| 20 6d 65 6d 6f 72 79 0a | 61 76 61 69 6c 61 62 6c | memory.|availabl|
|000007b0| 65 20 74 6f 20 74 68 65 | 20 4f 53 20 66 6f 72 20 |e to the| OS for |
|000007c0| 61 6c 6c 6f 63 61 74 69 | 6f 6e 20 74 6f 20 74 68 |allocati|on to th|
|000007d0| 65 20 63 68 69 6c 64 2c | 20 61 6e 64 20 69 74 20 |e child,| and it |
|000007e0| 68 61 73 20 74 6f 20 62 | 75 69 6c 64 0a 75 70 20 |has to b|uild.up |
|000007f0| 74 68 65 20 61 72 67 75 | 6d 65 6e 74 20 73 74 72 |the argu|ment str|
|00000800| 69 6e 67 20 66 6f 72 20 | 74 68 65 20 63 68 69 6c |ing for |the chil|
|00000810| 64 2e 0a 0a 41 6c 6c 20 | 47 45 4d 44 4f 53 20 70 |d...All |GEMDOS p|
|00000820| 72 6f 67 72 61 6d 73 20 | 61 72 65 20 73 74 61 72 |rograms |are star|
|00000830| 74 65 64 20 77 69 74 68 | 20 74 68 65 20 6c 61 72 |ted with| the lar|
|00000840| 67 65 73 74 20 62 6c 6f | 63 6b 20 6f 66 20 4f 53 |gest blo|ck of OS|
|00000850| 20 6d 65 6d 6f 72 79 20 | 0a 61 6c 6c 6f 63 61 74 | memory |.allocat|
|00000860| 65 64 20 74 6f 20 74 68 | 65 6d 2e 20 20 45 78 63 |ed to th|em. Exc|
|00000870| 65 70 74 20 69 6e 20 76 | 65 72 79 20 72 61 72 65 |ept in v|ery rare|
|00000880| 20 63 69 72 63 75 6d 73 | 74 61 6e 63 65 73 2c 20 | circums|tances, |
|00000890| 74 68 69 73 20 62 6c 6f | 63 6b 0a 69 73 20 74 68 |this blo|ck.is th|
|000008a0| 65 20 6f 6e 65 20 73 74 | 72 65 74 63 68 69 6e 67 |e one st|retching|
|000008b0| 20 66 72 6f 6d 20 74 68 | 65 20 65 6e 64 20 6f 66 | from th|e end of|
|000008c0| 20 74 68 65 20 61 63 63 | 65 73 73 6f 72 69 65 73 | the acc|essories|
|000008d0| 20 61 6e 64 20 72 65 73 | 69 64 65 6e 74 0a 75 74 | and res|ident.ut|
|000008e0| 69 6c 69 74 69 65 73 20 | 74 6f 20 74 68 65 20 62 |ilities |to the b|
|000008f0| 65 67 69 6e 6e 69 6e 67 | 20 6f 66 20 73 63 72 65 |eginning| of scre|
|00000900| 65 6e 20 6d 65 6d 6f 72 | 79 2e 20 54 68 65 20 70 |en memor|y. The p|
|00000910| 6f 69 6e 74 20 69 73 20 | 74 68 61 74 20 79 6f 75 |oint is |that you|
|00000920| 72 0a 70 72 6f 67 72 61 | 6d 20 68 61 73 20 70 72 |r.progra|m has pr|
|00000930| 6f 62 61 62 6c 79 20 62 | 65 65 6e 20 61 6c 6c 6f |obably b|een allo|
|00000940| 63 61 74 65 64 20 41 4c | 4c 20 6f 66 20 66 72 65 |cated AL|L of fre|
|00000950| 65 20 6d 65 6d 6f 72 79 | 2e 20 20 49 6e 20 6f 72 |e memory|. In or|
|00000960| 64 65 72 20 74 6f 0a 6d | 61 6b 65 20 6d 65 6d 6f |der to.m|ake memo|
|00000970| 72 79 20 61 76 61 69 6c | 61 62 6c 65 20 66 6f 72 |ry avail|able for|
|00000980| 20 61 20 63 68 69 6c 64 | 20 70 72 6f 63 65 73 73 | a child| process|
|00000990| 2c 20 79 6f 75 20 68 61 | 76 65 20 74 6f 20 53 48 |, you ha|ve to SH|
|000009a0| 52 49 4e 4b 20 74 68 65 | 0a 62 6c 6f 63 6b 20 79 |RINK the|.block y|
|000009b0| 6f 75 20 6f 77 6e 2c 20 | 72 65 74 75 72 6e 69 6e |ou own, |returnin|
|000009c0| 67 20 74 68 65 20 74 6f | 70 20 70 61 72 74 20 6f |g the to|p part o|
|000009d0| 66 20 69 74 20 74 6f 20 | 47 45 4d 44 4f 53 2e 20 |f it to |GEMDOS. |
|000009e0| 20 54 68 65 20 74 69 6d | 65 20 74 6f 0a 64 6f 20 | The tim|e to.do |
|000009f0| 74 68 69 73 20 69 73 20 | 77 68 65 6e 20 79 6f 75 |this is |when you|
|00000a00| 20 73 74 61 72 74 20 75 | 70 2e 0a 0a 49 66 20 79 | start u|p...If y|
|00000a10| 6f 75 20 75 73 65 20 41 | 6c 63 79 6f 6e 20 43 20 |ou use A|lcyon C |
|00000a20| 28 66 72 6f 6d 20 74 68 | 65 20 64 65 76 65 6c 6f |(from th|e develo|
|00000a30| 70 65 72 27 73 20 6b 69 | 74 29 2c 20 79 6f 75 20 |per's ki|t), you |
|00000a40| 6b 6e 6f 77 20 74 68 61 | 74 20 79 6f 75 0a 61 6c |know tha|t you.al|
|00000a50| 77 61 79 73 20 6c 69 6e | 6b 20 77 69 74 68 20 61 |ways lin|k with a|
|00000a60| 20 66 69 6c 65 20 63 61 | 6c 6c 65 64 20 47 45 4d | file ca|lled GEM|
|00000a70| 53 54 41 52 54 2e 20 20 | 49 66 20 79 6f 75 27 76 |START. |If you'v|
|00000a80| 65 20 62 65 65 6e 20 70 | 61 79 69 6e 67 20 0a 61 |e been p|aying .a|
|00000a90| 74 74 65 6e 74 69 6f 6e | 2c 20 79 6f 75 20 73 68 |ttention|, you sh|
|00000aa0| 6f 75 6c 64 20 68 61 76 | 65 20 67 6f 74 74 65 6e |ould hav|e gotten|
|00000ab0| 20 74 68 65 20 2a 6e 65 | 77 2a 20 47 45 4d 53 54 | the *ne|w* GEMST|
|00000ac0| 41 52 54 20 66 72 6f 6d | 20 43 6f 6d 70 75 73 65 |ART from| Compuse|
|00000ad0| 72 76 65 0a 28 6f 72 20 | 66 72 6f 6d 20 73 6f 6d |rve.(or |from som|
|00000ae0| 65 62 6f 64 79 20 65 6c | 73 65 20 77 68 6f 20 67 |ebody el|se who g|
|00000af0| 6f 74 20 69 74 29 3a 20 | 49 20 77 72 6f 74 65 20 |ot it): |I wrote |
|00000b00| 74 68 61 74 20 47 45 4d | 53 54 41 52 54 2e 20 20 |that GEM|START. |
|00000b10| 49 6e 0a 47 45 4d 53 54 | 41 52 54 2e 53 2c 20 74 |In.GEMST|ART.S, t|
|00000b20| 68 65 72 65 20 69 73 20 | 61 20 6c 6f 74 20 6f 66 |here is |a lot of|
|00000b30| 20 64 69 73 63 75 73 73 | 69 6f 6e 20 61 62 6f 75 | discuss|ion abou|
|00000b40| 74 20 6d 65 6d 6f 72 79 | 20 6d 6f 64 65 6c 73 2c |t memory| models,|
|00000b50| 20 61 6e 64 20 74 68 65 | 6e 0a 61 20 76 61 72 69 | and the|n.a vari|
|00000b60| 61 62 6c 65 20 79 6f 75 | 20 73 65 74 20 74 65 6c |able you| set tel|
|00000b70| 6c 69 6e 67 20 68 6f 77 | 20 6d 75 63 68 20 6d 65 |ling how| much me|
|00000b80| 6d 6f 72 79 20 79 6f 75 | 20 77 61 6e 74 20 74 6f |mory you| want to|
|00000b90| 20 6b 65 65 70 20 6f 72 | 20 67 69 76 65 20 62 61 | keep or| give ba|
|00000ba0| 63 6b 0a 74 6f 20 74 68 | 65 20 4f 53 2e 20 20 4d |ck.to th|e OS. M|
|00000bb0| 61 6b 65 20 79 6f 75 72 | 20 63 68 6f 69 63 65 20 |ake your| choice |
|00000bc0| 28 77 68 65 6e 20 69 6e | 20 64 6f 75 62 74 2c 20 |(when in| doubt, |
|00000bd0| 75 73 65 20 53 54 41 43 | 4b 3d 31 29 2c 20 61 73 |use STAC|K=1), as|
|00000be0| 73 65 6d 62 6c 65 0a 47 | 45 4d 53 54 41 52 54 2e |semble.G|EMSTART.|
|00000bf0| 53 2c 20 63 61 6c 6c 20 | 74 68 65 20 72 65 73 75 |S, call |the resu|
|00000c00| 6c 74 20 47 45 4d 53 45 | 58 45 43 2e 4f 20 28 6f |lt GEMSE|XEC.O (o|
|00000c10| 72 20 73 6f 6d 65 74 68 | 69 6e 67 29 2c 20 61 6e |r someth|ing), an|
|00000c20| 64 20 6c 69 6e 6b 20 74 | 68 65 0a 70 72 6f 67 72 |d link t|he.progr|
|00000c30| 61 6d 73 20 77 68 69 63 | 68 20 50 65 78 65 63 20 |ams whic|h Pexec |
|00000c40| 77 69 74 68 20 74 68 61 | 74 20 66 69 6c 65 20 72 |with tha|t file r|
|00000c50| 61 74 68 65 72 20 74 68 | 61 6e 20 74 68 65 20 6e |ather th|an the n|
|00000c60| 6f 72 6d 61 6c 20 47 45 | 4d 53 54 41 52 54 2e 0a |ormal GE|MSTART..|
|00000c70| 0a 4e 6f 77 20 68 65 72 | 65 27 73 20 61 20 64 69 |.Now her|e's a di|
|00000c80| 73 63 75 73 73 69 6f 6e | 20 6f 66 20 77 68 61 74 |scussion| of what|
|00000c90| 20 47 45 4d 53 54 41 52 | 54 20 68 61 73 20 74 6f | GEMSTAR|T has to|
|00000ca0| 20 64 6f 20 77 69 74 68 | 20 72 65 73 70 65 63 74 | do with| respect|
|00000cb0| 20 74 6f 0a 6b 65 65 70 | 69 6e 67 20 6f 72 20 72 | to.keep|ing or r|
|00000cc0| 65 74 75 72 6e 69 6e 67 | 20 6d 65 6d 6f 72 79 3a |eturning| memory:|
|00000cd0| 0a 0a 59 6f 75 72 20 70 | 72 6f 67 72 61 6d 20 69 |..Your p|rogram i|
|00000ce0| 73 20 69 6e 76 6f 6b 65 | 64 20 77 69 74 68 20 74 |s invoke|d with t|
|00000cf0| 68 65 20 61 64 64 72 65 | 73 73 20 6f 66 20 69 74 |he addre|ss of it|
|00000d00| 73 20 6f 77 6e 20 62 61 | 73 65 70 61 67 65 20 61 |s own ba|sepage a|
|00000d10| 73 0a 74 68 65 20 61 72 | 67 75 6d 65 6e 74 20 74 |s.the ar|gument t|
|00000d20| 6f 20 61 20 66 75 6e 63 | 74 69 6f 6e 20 28 74 68 |o a func|tion (th|
|00000d30| 61 74 20 69 73 2c 20 61 | 74 20 34 28 73 70 29 2e |at is, a|t 4(sp).|
|00000d40| 6c 29 2e 20 20 49 6e 20 | 74 68 69 73 20 62 61 73 |l). In |this bas|
|00000d50| 65 70 61 67 65 0a 69 73 | 20 74 68 65 20 73 74 72 |epage.is| the str|
|00000d60| 75 63 74 75 72 65 20 79 | 6f 75 20 63 61 6e 20 66 |ucture y|ou can f|
|00000d70| 69 6e 64 20 69 6e 20 79 | 6f 75 72 20 64 6f 63 75 |ind in y|our docu|
|00000d80| 6d 65 6e 74 61 74 69 6f | 6e 2e 20 20 54 68 65 20 |mentatio|n. The |
|00000d90| 69 6e 74 65 72 65 73 74 | 69 6e 67 0a 66 69 65 6c |interest|ing.fiel|
|00000da0| 64 73 20 61 72 65 20 48 | 49 54 50 41 20 28 74 68 |ds are H|ITPA (th|
|00000db0| 65 20 61 64 64 72 65 73 | 73 20 6f 66 20 66 69 72 |e addres|s of fir|
|00000dc0| 73 74 20 62 79 74 65 20 | 4e 4f 54 20 69 6e 20 79 |st byte |NOT in y|
|00000dd0| 6f 75 72 20 54 50 41 29 | 2c 0a 42 53 53 42 41 53 |our TPA)|,.BSSBAS|
|00000de0| 45 20 28 74 68 65 20 66 | 69 72 73 74 20 61 64 64 |E (the f|irst add|
|00000df0| 72 65 73 73 20 6f 66 20 | 79 6f 75 72 20 62 73 73 |ress of |your bss|
|00000e00| 29 20 61 6e 64 20 42 53 | 53 4c 45 4e 20 28 74 68 |) and BS|SLEN (th|
|00000e10| 65 20 6c 65 6e 67 74 68 | 20 6f 66 0a 79 6f 75 72 |e length| of.your|
|00000e20| 20 42 53 53 29 2e 0a 0a | 59 6f 75 72 20 73 74 61 | BSS)...|Your sta|
|00000e30| 63 6b 20 70 6f 69 6e 74 | 65 72 20 73 74 61 72 74 |ck point|er start|
|00000e40| 73 20 61 74 20 48 49 54 | 50 41 2d 38 20 28 62 65 |s at HIT|PA-8 (be|
|00000e50| 63 61 75 73 65 20 38 20 | 69 73 20 74 68 65 20 6c |cause 8 |is the l|
|00000e60| 65 6e 67 74 68 20 6f 66 | 20 74 68 65 0a 62 61 73 |ength of| the.bas|
|00000e70| 65 70 61 67 65 20 61 72 | 67 75 6d 65 6e 74 20 61 |epage ar|gument a|
|00000e80| 6e 64 20 74 68 65 20 64 | 75 6d 6d 79 20 72 65 74 |nd the d|ummy ret|
|00000e90| 75 72 6e 20 50 43 20 6f | 6e 20 74 68 65 20 73 74 |urn PC o|n the st|
|00000ea0| 61 63 6b 29 2e 20 20 54 | 68 65 20 73 70 61 63 65 |ack). T|he space|
|00000eb0| 20 66 72 6f 6d 0a 42 53 | 53 42 41 53 45 2b 42 53 | from.BS|SBASE+BS|
|00000ec0| 53 4c 45 4e 20 74 6f 20 | 79 6f 75 72 20 53 50 20 |SLEN to |your SP |
|00000ed0| 69 73 20 74 68 65 20 22 | 73 74 61 63 6b 2b 68 65 |is the "|stack+he|
|00000ee0| 61 70 22 20 73 70 61 63 | 65 2e 20 20 4c 69 62 72 |ap" spac|e. Libr|
|00000ef0| 61 72 79 20 6d 61 6c 6c | 6f 63 28 29 0a 63 61 6c |ary mall|oc().cal|
|00000f00| 6c 73 20 75 73 65 20 74 | 68 69 73 20 73 70 61 63 |ls use t|his spac|
|00000f10| 65 2c 20 6d 6f 76 69 6e | 67 20 61 20 70 6f 69 6e |e, movin|g a poin|
|00000f20| 74 65 72 20 63 61 6c 6c | 65 64 20 74 68 65 20 22 |ter call|ed the "|
|00000f30| 62 72 65 61 6b 22 20 28 | 69 6e 20 74 68 65 0a 76 |break" (|in the.v|
|00000f40| 61 72 69 61 62 6c 65 20 | 5f 5f 62 72 65 61 6b 2c |ariable |__break,|
|00000f50| 20 6f 72 20 74 68 65 20 | 43 20 76 61 72 69 61 62 | or the |C variab|
|00000f60| 6c 65 20 5f 62 72 65 61 | 6b 20 69 66 20 79 6f 75 |le _brea|k if you|
|00000f70| 20 75 73 65 20 41 6c 63 | 79 6f 6e 20 43 29 20 75 | use Alc|yon C) u|
|00000f80| 70 20 61 73 20 69 74 0a | 75 73 65 73 20 6d 65 6d |p as it.|uses mem|
|00000f90| 6f 72 79 2e 20 20 59 6f | 75 72 20 73 74 61 63 6b |ory. Yo|ur stack|
|00000fa0| 20 70 6f 69 6e 74 65 72 | 20 6d 6f 76 65 73 20 64 | pointer| moves d|
|00000fb0| 6f 77 6e 20 66 72 6f 6d | 20 74 68 65 20 74 6f 70 |own from| the top|
|00000fc0| 20 61 73 20 69 74 20 75 | 73 65 73 0a 6d 65 6d 6f | as it u|ses.memo|
|00000fd0| 72 79 2c 20 61 6e 64 20 | 69 66 20 74 68 65 20 73 |ry, and |if the s|
|00000fe0| 70 20 61 6e 64 20 5f 62 | 72 65 61 6b 20 65 76 65 |p and _b|reak eve|
|00000ff0| 72 20 6d 65 65 74 2c 20 | 79 6f 75 27 72 65 20 6f |r meet, |you're o|
|00001000| 75 74 20 6f 66 20 6d 65 | 6d 6f 72 79 2e 20 20 49 |ut of me|mory. I|
|00001010| 6e 0a 66 61 63 74 2c 20 | 69 66 20 74 68 65 79 20 |n.fact, |if they |
|00001020| 65 76 65 72 20 63 6f 6d | 65 20 63 6c 6f 73 65 20 |ever com|e close |
|00001030| 28 77 69 74 68 69 6e 20 | 61 20 22 63 68 69 63 6b |(within |a "chick|
|00001040| 65 6e 20 66 61 63 74 6f | 72 22 20 6f 66 20 61 62 |en facto|r" of ab|
|00001050| 6f 75 74 20 35 31 32 0a | 62 79 74 65 73 20 6f 72 |out 512.|bytes or|
|00001060| 20 31 4b 29 2c 20 6d 61 | 6c 6c 6f 63 28 29 20 77 | 1K), ma|lloc() w|
|00001070| 69 6c 6c 20 66 61 69 6c | 20 62 65 63 61 75 73 65 |ill fail| because|
|00001080| 20 69 74 20 64 6f 65 73 | 6e 27 74 20 77 61 6e 74 | it does|n't want|
|00001090| 20 79 6f 75 72 20 73 74 | 61 63 6b 20 74 6f 0a 6f | your st|ack to.o|
|000010a0| 76 65 72 77 72 69 74 65 | 20 67 6f 6f 64 20 64 61 |verwrite| good da|
|000010b0| 74 61 2e 20 0a 0a 57 68 | 65 6e 20 61 20 70 72 6f |ta. ..Wh|en a pro|
|000010c0| 63 65 73 73 20 73 74 61 | 72 74 73 2c 20 69 74 20 |cess sta|rts, it |
|000010d0| 67 65 74 73 20 2a 61 6c | 6c 2a 20 6f 66 20 6d 65 |gets *al|l* of me|
|000010e0| 6d 6f 72 79 20 61 6c 6c | 6f 63 61 74 65 64 20 74 |mory all|ocated t|
|000010f0| 6f 20 69 74 3a 20 66 72 | 6f 6d 20 74 68 65 0a 65 |o it: fr|om the.e|
|00001100| 6e 64 20 6f 66 20 61 6e | 79 20 61 63 63 65 73 73 |nd of an|y access|
|00001110| 6f 72 69 65 73 20 6f 72 | 20 72 65 73 69 64 65 6e |ories or| residen|
|00001120| 74 20 75 74 69 6c 69 74 | 69 65 73 20 75 70 20 74 |t utilit|ies up t|
|00001130| 6f 20 74 68 65 20 64 65 | 66 61 75 6c 74 20 73 63 |o the de|fault sc|
|00001140| 72 65 65 6e 0a 6d 65 6d | 6f 72 79 2e 20 20 49 66 |reen.mem|ory. If|
|00001150| 20 79 6f 75 20 77 61 6e | 74 20 74 6f 20 75 73 65 | you wan|t to use|
|00001160| 20 50 65 78 65 63 2c 20 | 79 6f 75 20 68 61 76 65 | Pexec, |you have|
|00001170| 20 74 6f 20 67 69 76 65 | 20 73 6f 6d 65 20 6d 65 | to give| some me|
|00001180| 6d 6f 72 79 20 62 61 63 | 6b 20 74 6f 0a 74 68 65 |mory bac|k to.the|
|00001190| 20 4f 53 2e 20 20 59 6f | 75 20 64 6f 20 74 68 69 | OS. Yo|u do thi|
|000011a0| 73 20 77 69 74 68 20 74 | 68 65 20 4d 73 68 72 69 |s with t|he Mshri|
|000011b0| 6e 6b 20 63 61 6c 6c 2e | 20 20 49 74 73 20 61 72 |nk call.| Its ar|
|000011c0| 67 75 6d 65 6e 74 73 20 | 61 72 65 20 74 68 65 0a |guments |are the.|
|000011d0| 61 64 64 72 65 73 73 20 | 6f 66 20 74 68 65 20 6d |address |of the m|
|000011e0| 65 6d 6f 72 79 20 62 6c | 6f 63 6b 20 74 6f 20 73 |emory bl|ock to s|
|000011f0| 68 72 69 6e 6b 20 28 79 | 6f 75 72 20 62 61 73 65 |hrink (y|our base|
|00001200| 70 61 67 65 20 61 64 64 | 72 65 73 73 29 20 61 6e |page add|ress) an|
|00001210| 64 20 74 68 65 0a 6e 65 | 77 20 73 69 7a 65 20 74 |d the.ne|w size t|
|00001220| 6f 20 73 68 72 69 6e 6b | 20 69 74 20 74 6f 2e 20 |o shrink| it to. |
|00001230| 20 59 6f 75 20 73 68 6f | 75 6c 64 20 62 65 20 73 | You sho|uld be s|
|00001240| 75 72 65 20 74 6f 20 6c | 65 61 76 65 20 65 6e 6f |ure to l|eave eno|
|00001250| 75 67 68 20 72 6f 6f 6d | 20 61 62 6f 76 65 0a 79 |ugh room| above.y|
|00001260| 6f 75 72 20 42 53 53 20 | 66 6f 72 20 61 20 72 65 |our BSS |for a re|
|00001270| 61 73 6f 6e 61 62 6c 65 | 20 73 74 61 63 6b 20 28 |asonable| stack (|
|00001280| 61 74 20 6c 65 61 73 74 | 20 32 4b 29 20 70 6c 75 |at least| 2K) plu|
|00001290| 73 20 61 6e 79 20 6d 61 | 6c 6c 6f 63 28 29 20 63 |s any ma|lloc() c|
|000012a0| 61 6c 6c 73 0a 79 6f 75 | 20 65 78 70 65 63 74 20 |alls.you| expect |
|000012b0| 74 6f 20 6d 61 6b 65 2e | 20 20 4c 65 74 27 73 20 |to make.| Let's |
|000012c0| 73 61 79 20 79 6f 75 27 | 72 65 20 77 72 69 74 69 |say you'|re writi|
|000012d0| 6e 67 20 22 6d 61 6b 65 | 22 20 61 6e 64 20 79 6f |ng "make|" and yo|
|000012e0| 75 20 77 61 6e 74 20 74 | 6f 0a 6c 65 61 76 65 20 |u want t|o.leave |
|000012f0| 61 62 6f 75 74 20 33 32 | 4b 20 66 6f 72 20 6d 61 |about 32|K for ma|
|00001300| 6c 6c 6f 63 28 29 20 28 | 66 6f 72 20 79 6f 75 72 |lloc() (|for your|
|00001310| 20 64 65 70 65 6e 64 65 | 6e 63 79 20 73 74 72 75 | depende|ncy stru|
|00001320| 63 74 75 72 65 73 29 2e | 20 20 41 6c 73 6f 2c 0a |ctures).| Also,.|
|00001330| 73 69 6e 63 65 20 6d 61 | 6b 65 20 69 73 20 72 65 |since ma|ke is re|
|00001340| 63 75 72 73 69 76 65 2c | 20 79 6f 75 20 73 68 6f |cursive,| you sho|
|00001350| 75 6c 64 20 6c 65 61 76 | 65 20 6c 6f 74 73 20 6f |uld leav|e lots o|
|00001360| 66 20 73 70 61 63 65 20 | 66 6f 72 20 74 68 65 20 |f space |for the |
|00001370| 73 74 61 63 6b 20 2d 0a | 6d 61 79 62 65 20 61 6e |stack -.|maybe an|
|00001380| 6f 74 68 65 72 20 31 36 | 4b 2e 20 20 54 68 65 20 |other 16|K. The |
|00001390| 6e 65 77 20 74 6f 70 20 | 6f 66 20 6d 65 6d 6f 72 |new top |of memor|
|000013a0| 79 20 74 68 61 74 20 79 | 6f 75 72 20 70 72 6f 67 |y that y|our prog|
|000013b0| 72 61 6d 20 6e 65 65 64 | 73 20 69 73 3a 0a 0a 20 |ram need|s is:.. |
|000013c0| 20 20 20 6e 65 77 74 6f | 70 20 3d 20 79 6f 75 72 | newto|p = your|
|000013d0| 20 62 73 73 20 62 61 73 | 65 20 61 64 64 72 65 73 | bss bas|e addres|
|000013e0| 73 20 2b 20 79 6f 75 72 | 20 62 73 73 20 73 69 7a |s + your| bss siz|
|000013f0| 65 20 2b 20 31 36 4b 20 | 73 74 61 63 6b 20 2b 20 |e + 16K |stack + |
|00001400| 33 32 4b 20 68 65 61 70 | 0a 0a 53 69 6e 63 65 20 |32K heap|..Since |
|00001410| 79 6f 75 72 20 73 74 61 | 63 6b 20 70 6f 69 6e 74 |your sta|ck point|
|00001420| 65 72 20 69 73 20 61 74 | 20 74 68 65 20 74 6f 70 |er is at| the top|
|00001430| 20 6f 66 20 79 6f 75 72 | 20 43 55 52 52 45 4e 54 | of your| CURRENT|
|00001440| 20 54 50 41 2c 20 61 6e | 64 20 79 6f 75 27 72 65 | TPA, an|d you're|
|00001450| 20 61 62 6f 75 74 0a 74 | 6f 20 73 68 72 69 6e 6b | about.t|o shrink|
|00001460| 20 74 68 61 74 2c 20 79 | 6f 75 27 64 20 62 65 74 | that, y|ou'd bet|
|00001470| 74 65 72 20 6d 6f 76 65 | 20 79 6f 75 72 20 73 74 |ter move| your st|
|00001480| 61 63 6b 3a 0a 0a 20 20 | 20 20 6d 6f 76 65 2e 6c |ack:.. | move.l|
|00001490| 20 20 20 20 20 20 6e 65 | 77 74 6f 70 2c 73 70 0a | ne|wtop,sp.|
|000014a0| 0a 4e 6f 77 20 79 6f 75 | 20 77 61 6e 74 20 74 6f |.Now you| want to|
|000014b0| 20 63 6f 6d 70 75 74 65 | 20 79 6f 75 72 20 6e 65 | compute| your ne|
|000014c0| 77 20 54 50 41 20 73 69 | 7a 65 20 61 6e 64 20 63 |w TPA si|ze and c|
|000014d0| 61 6c 6c 20 4d 73 68 72 | 69 6e 6b 3a 0a 0a 20 20 |all Mshr|ink:.. |
|000014e0| 20 20 6d 6f 76 65 2e 6c | 20 20 20 20 20 20 6e 65 | move.l| ne|
|000014f0| 77 74 6f 70 2c 64 30 0a | 20 20 20 20 73 75 62 2e |wtop,d0.| sub.|
|00001500| 6c 20 20 20 20 20 20 20 | 62 61 73 65 70 61 67 65 |l |basepage|
|00001510| 2c 64 30 20 20 20 20 20 | 3b 20 6e 65 77 74 6f 70 |,d0 |; newtop|
|00001520| 2d 62 61 73 65 70 61 67 | 65 20 69 73 20 64 65 73 |-basepag|e is des|
|00001530| 69 72 65 64 20 54 50 41 | 20 73 69 7a 65 0a 20 20 |ired TPA| size. |
|00001540| 20 20 6d 6f 76 65 2e 6c | 20 20 20 20 20 20 64 30 | move.l| d0|
|00001550| 2c 2d 28 73 70 29 20 20 | 20 20 20 20 20 20 3b 20 |,-(sp) | ; |
|00001560| 73 65 74 20 75 70 20 4d | 73 68 72 69 6e 6b 28 62 |set up M|shrink(b|
|00001570| 61 73 65 70 61 67 65 2c | 64 30 29 0a 20 20 20 20 |asepage,|d0). |
|00001580| 6d 6f 76 65 2e 6c 20 20 | 20 20 20 20 62 61 73 65 |move.l | base|
|00001590| 70 61 67 65 2c 2d 28 73 | 70 29 0a 20 20 20 20 6d |page,-(s|p). m|
|000015a0| 6f 76 65 2e 77 20 20 20 | 20 20 20 23 24 34 61 20 |ove.w | #$4a |
|000015b0| 20 20 20 20 20 20 20 20 | 20 20 20 3b 20 66 6e 20 | | ; fn |
|000015c0| 63 6f 64 65 20 66 6f 72 | 20 4d 73 68 72 69 6e 6b |code for| Mshrink|
|000015d0| 0a 20 20 20 20 74 72 61 | 70 20 20 20 20 20 20 20 |. tra|p |
|000015e0| 20 23 31 0a 20 20 20 20 | 61 64 64 2e 6c 20 20 20 | #1. |add.l |
|000015f0| 20 20 20 20 23 31 30 2c | 73 70 20 20 20 20 20 20 | #10,|sp |
|00001600| 20 20 20 20 3b 20 63 6c | 65 61 6e 20 75 70 20 61 | ; cl|ean up a|
|00001610| 72 67 73 0a 0a 4e 6f 77 | 20 74 68 61 74 20 79 6f |rgs..Now| that yo|
|00001620| 75 27 76 65 20 73 68 72 | 75 6e 6b 20 79 6f 75 72 |u've shr|unk your|
|00001630| 20 54 50 41 2c 20 74 68 | 65 20 4f 53 20 63 61 6e | TPA, th|e OS can|
|00001640| 20 61 6c 6c 6f 63 61 74 | 65 20 74 68 69 73 20 6e | allocat|e this n|
|00001650| 65 77 20 6d 65 6d 6f 72 | 79 20 74 6f 0a 79 6f 75 |ew memor|y to.you|
|00001660| 72 20 63 68 69 6c 64 2e | 20 20 49 74 20 63 61 6e |r child.| It can|
|00001670| 20 61 6c 73 6f 20 75 73 | 65 20 74 68 69 73 20 6d | also us|e this m|
|00001680| 65 6d 6f 72 79 20 66 6f | 72 20 4d 61 6c 6c 6f 63 |emory fo|r Malloc|
|00001690| 28 29 2c 20 77 68 69 63 | 68 20 69 73 20 75 73 65 |(), whic|h is use|
|000016a0| 64 0a 6f 63 63 61 73 69 | 6f 6e 61 6c 6c 79 20 62 |d.occasi|onally b|
|000016b0| 79 20 47 45 4d 20 56 44 | 49 20 66 6f 72 20 62 6c |y GEM VD|I for bl|
|000016c0| 74 20 62 75 66 66 65 72 | 73 2c 20 65 74 63 2e 20 |t buffer|s, etc. |
|000016d0| 20 4e 6f 74 65 20 74 68 | 61 74 20 79 6f 75 20 6f | Note th|at you o|
|000016e0| 6e 6c 79 0a 68 61 76 65 | 20 74 6f 20 64 6f 20 74 |nly.have| to do t|
|000016f0| 68 69 73 20 6f 6e 63 65 | 2c 20 77 68 65 6e 20 79 |his once|, when y|
|00001700| 6f 75 20 73 74 61 72 74 | 20 75 70 3a 20 61 66 74 |ou start| up: aft|
|00001710| 65 72 20 74 68 61 74 2c | 20 79 6f 75 20 63 61 6e |er that,| you can|
|00001720| 20 64 6f 20 61 73 20 6d | 75 63 68 0a 50 65 78 65 | do as m|uch.Pexe|
|00001730| 63 27 69 6e 67 20 61 73 | 20 79 6f 75 20 77 61 6e |c'ing as| you wan|
|00001740| 74 2e 0a 0a 57 68 65 6e | 20 79 6f 75 20 77 61 6e |t...When| you wan|
|00001750| 74 20 74 6f 20 65 78 65 | 63 20 61 20 63 68 69 6c |t to exe|c a chil|
|00001760| 64 2c 20 79 6f 75 20 62 | 75 69 6c 64 20 69 74 73 |d, you b|uild its|
|00001770| 20 63 6f 6d 70 6c 65 74 | 65 20 66 69 6c 65 73 70 | complet|e filesp|
|00001780| 65 63 20 69 6e 74 6f 20 | 6f 6e 65 0a 73 74 72 69 |ec into |one.stri|
|00001790| 6e 67 2c 20 61 6e 64 20 | 69 74 73 20 61 72 67 75 |ng, and |its argu|
|000017a0| 6d 65 6e 74 73 20 69 6e | 74 6f 20 61 6e 6f 74 68 |ments in|to anoth|
|000017b0| 65 72 2e 20 20 54 68 65 | 20 61 72 67 75 6d 65 6e |er. The| argumen|
|000017c0| 74 20 73 74 72 69 6e 67 | 20 69 73 20 61 20 6c 69 |t string| is a li|
|000017d0| 74 74 6c 65 0a 73 74 72 | 61 6e 67 65 3a 20 74 68 |ttle.str|ange: th|
|000017e0| 65 20 66 69 72 73 74 20 | 63 68 61 72 61 63 74 65 |e first |characte|
|000017f0| 72 20 6f 66 20 74 68 65 | 20 61 72 67 75 6d 65 6e |r of the| argumen|
|00001800| 74 20 73 74 72 69 6e 67 | 20 69 73 20 74 68 65 20 |t string| is the |
|00001810| 6c 65 6e 67 74 68 20 6f | 66 20 74 68 65 0a 72 65 |length o|f the.re|
|00001820| 73 74 20 6f 66 20 74 68 | 65 20 73 74 72 69 6e 67 |st of th|e string|
|00001830| 21 0a 0a 48 65 72 65 20 | 69 73 20 61 20 73 69 6d |!..Here |is a sim|
|00001840| 70 6c 65 20 73 79 73 74 | 65 6d 20 63 61 6c 6c 3a |ple syst|em call:|
|00001850| 20 70 61 73 73 20 69 74 | 20 74 68 65 20 6e 61 6d | pass it| the nam|
|00001860| 65 20 6f 66 20 74 68 65 | 20 66 69 6c 65 20 74 6f |e of the| file to|
|00001870| 20 65 78 65 63 75 74 65 | 0a 61 6e 64 20 74 68 65 | execute|.and the|
|00001880| 20 61 72 67 75 6d 65 6e | 74 20 73 74 72 69 6e 67 | argumen|t string|
|00001890| 20 74 6f 20 75 73 65 2e | 0a 0a 20 20 20 20 20 20 | to use.|.. |
|000018a0| 20 20 6c 6f 6e 67 20 73 | 79 73 74 65 6d 28 63 6d | long s|ystem(cm|
|000018b0| 64 2c 61 72 67 73 29 0a | 20 20 20 20 20 20 20 20 |d,args).| |
|000018c0| 63 68 61 72 20 2a 63 6d | 64 2c 20 2a 61 72 67 73 |char *cm|d, *args|
|000018d0| 3b 0a 20 20 20 20 20 20 | 20 20 7b 0a 20 20 20 20 |;. | {. |
|000018e0| 20 20 20 20 20 20 20 20 | 63 68 61 72 20 62 75 66 | |char buf|
|000018f0| 5b 31 32 38 5d 3b 0a 0a | 20 20 20 20 20 20 20 20 |[128];..| |
|00001900| 20 20 20 20 69 66 20 28 | 73 74 72 6c 65 6e 28 61 | if (|strlen(a|
|00001910| 72 67 73 29 20 3e 20 31 | 32 36 29 20 7b 0a 20 20 |rgs) > 1|26) {. |
|00001920| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 70 72 | | pr|
|00001930| 69 6e 74 66 28 22 61 72 | 67 75 6d 65 6e 74 20 73 |intf("ar|gument s|
|00001940| 74 72 69 6e 67 20 74 6f | 6f 20 6c 6f 6e 67 5c 6e |tring to|o long\n|
|00001950| 22 29 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |");. | |
|00001960| 20 20 20 20 72 65 74 75 | 72 6e 20 2d 31 3b 0a 20 | retu|rn -1;. |
|00001970| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0a 20 20 20 | | }. |
|00001980| 20 20 20 20 20 20 20 20 | 20 73 74 72 63 70 79 28 | | strcpy(|
|00001990| 62 75 66 2b 31 2c 61 72 | 67 73 29 3b 20 20 20 20 |buf+1,ar|gs); |
|000019a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|000019b0| 63 6f 70 79 20 61 72 67 | 73 20 74 6f 20 62 75 66 |copy arg|s to buf|
|000019c0| 66 65 72 2b 31 20 2a 2f | 0a 20 20 20 20 20 20 20 |fer+1 */|. |
|000019d0| 20 20 20 20 20 62 75 66 | 5b 30 5d 20 3d 20 73 74 | buf|[0] = st|
|000019e0| 72 6c 65 6e 28 61 72 67 | 73 29 3b 20 20 20 20 20 |rlen(arg|s); |
|000019f0| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 73 65 74 20 | | /* set |
|00001a00| 62 75 66 66 65 72 5b 30 | 5d 20 74 6f 20 6c 65 6e |buffer[0|] to len|
|00001a10| 20 2a 2f 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | */. | |
|00001a20| 72 65 74 75 72 6e 20 50 | 65 78 65 63 28 30 2c 63 |return P|exec(0,c|
|00001a30| 6d 64 2c 62 75 66 2c 30 | 4c 29 3b 0a 20 20 20 20 |md,buf,0|L);. |
|00001a40| 20 20 20 20 7d 0a 0a 54 | 68 65 20 66 69 72 73 74 | }..T|he first|
|00001a50| 20 7a 65 72 6f 20 69 6e | 20 74 68 65 20 50 65 78 | zero in| the Pex|
|00001a60| 65 63 20 63 61 6c 6c 20 | 69 73 20 74 68 65 20 50 |ec call |is the P|
|00001a70| 65 78 65 63 20 66 75 6e | 63 74 69 6f 6e 20 63 6f |exec fun|ction co|
|00001a80| 64 65 3a 20 6c 6f 61 64 | 20 61 6e 64 0a 67 6f 2e |de: load| and.go.|
|00001a90| 20 20 54 68 65 20 63 6d | 64 20 61 72 67 75 6d 65 | The cm|d argume|
|00001aa0| 6e 74 20 69 73 20 74 68 | 65 20 66 75 6c 6c 20 66 |nt is th|e full f|
|00001ab0| 69 6c 65 73 70 65 63 2c | 20 77 69 74 68 20 74 68 |ilespec,| with th|
|00001ac0| 65 20 70 61 74 68 2c 20 | 66 69 6c 65 20 6e 61 6d |e path, |file nam|
|00001ad0| 65 2c 0a 61 6e 64 20 66 | 69 6c 65 20 74 79 70 65 |e,.and f|ile type|
|00001ae0| 2e 20 20 54 68 65 20 74 | 68 69 72 64 20 61 72 67 |. The t|hird arg|
|00001af0| 75 6d 65 6e 74 20 69 73 | 20 74 68 65 20 63 6f 6d |ument is| the com|
|00001b00| 6d 61 6e 64 2d 6c 69 6e | 65 20 61 72 67 75 6d 65 |mand-lin|e argume|
|00001b10| 6e 74 20 73 74 72 69 6e | 67 2c 0a 61 6e 64 20 74 |nt strin|g,.and t|
|00001b20| 68 65 20 66 6f 75 72 74 | 68 20 61 72 67 75 6d 65 |he fourt|h argume|
|00001b30| 6e 74 20 69 73 20 74 68 | 65 20 65 6e 76 69 72 6f |nt is th|e enviro|
|00001b40| 6e 6d 65 6e 74 20 70 6f | 69 6e 74 65 72 2e 20 20 |nment po|inter. |
|00001b50| 41 20 6e 75 6c 6c 20 65 | 6e 76 69 72 6f 6e 6d 65 |A null e|nvironme|
|00001b60| 6e 74 0a 70 6f 69 6e 74 | 65 72 20 6d 65 61 6e 73 |nt.point|er means|
|00001b70| 20 22 6c 65 74 20 74 68 | 65 20 63 68 69 6c 64 20 | "let th|e child |
|00001b80| 69 6e 68 65 72 69 74 20 | 41 20 43 4f 50 59 20 4f |inherit |A COPY O|
|00001b90| 46 20 6d 79 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |F my env|ironment|
|00001ba0| 2e 22 0a 0a 54 68 69 73 | 20 63 61 6c 6c 20 77 69 |."..This| call wi|
|00001bb0| 6c 6c 20 6c 6f 61 64 20 | 74 68 65 20 70 72 6f 67 |ll load |the prog|
|00001bc0| 72 61 6d 2c 20 70 61 73 | 73 20 74 68 65 20 61 72 |ram, pas|s the ar|
|00001bd0| 67 75 6d 65 6e 74 73 20 | 61 6e 64 20 65 6e 76 69 |guments |and envi|
|00001be0| 72 6f 6e 6d 65 6e 74 20 | 74 6f 0a 69 74 2c 20 61 |ronment |to.it, a|
|00001bf0| 6e 64 20 65 78 65 63 75 | 74 65 20 69 74 2e 20 20 |nd execu|te it. |
|00001c00| 57 68 65 6e 20 74 68 65 | 20 70 72 6f 67 72 61 6d |When the| program|
|00001c10| 20 74 65 72 6d 69 6e 61 | 74 65 73 2c 20 74 68 65 | termina|tes, the|
|00001c20| 20 63 61 6c 6c 20 72 65 | 74 75 72 6e 73 20 74 68 | call re|turns th|
|00001c30| 65 0a 65 78 69 74 20 63 | 6f 64 65 20 66 72 6f 6d |e.exit c|ode from|
|00001c40| 20 74 68 65 20 70 72 6f | 67 72 61 6d 2e 20 20 49 | the pro|gram. I|
|00001c50| 66 20 74 68 65 20 50 65 | 78 65 63 20 66 61 69 6c |f the Pe|xec fail|
|00001c60| 73 20 28 6e 6f 74 20 65 | 6e 6f 75 67 68 20 6d 65 |s (not e|nough me|
|00001c70| 6d 6f 72 79 2c 20 66 69 | 6c 65 0a 6e 6f 74 20 66 |mory, fi|le.not f|
|00001c80| 6f 75 6e 64 2c 20 65 74 | 63 2e 29 20 61 20 6e 65 |ound, et|c.) a ne|
|00001c90| 67 61 74 69 76 65 20 63 | 6f 64 65 20 69 73 20 72 |gative c|ode is r|
|00001ca0| 65 74 75 72 6e 65 64 2c | 20 61 6e 64 20 79 6f 75 |eturned,| and you|
|00001cb0| 20 73 68 6f 75 6c 64 20 | 64 65 61 6c 20 77 69 74 | should |deal wit|
|00001cc0| 68 0a 69 74 20 61 63 63 | 6f 72 64 69 6e 67 6c 79 |h.it acc|ordingly|
|00001cd0| 2e 20 20 4e 6f 74 65 20 | 74 68 61 74 20 65 72 72 |. Note |that err|
|00001ce0| 6f 72 20 72 65 74 75 72 | 6e 73 20 66 72 6f 6d 20 |or retur|ns from |
|00001cf0| 50 65 78 65 63 20 61 72 | 65 20 61 6c 77 61 79 73 |Pexec ar|e always|
|00001d00| 20 6e 65 67 61 74 69 76 | 65 0a 4c 4f 4e 47 53 2c | negativ|e.LONGS,|
|00001d10| 20 77 68 69 6c 65 20 72 | 65 74 75 72 6e 20 63 6f | while r|eturn co|
|00001d20| 64 65 73 20 66 72 6f 6d | 20 74 68 65 20 63 68 69 |des from| the chi|
|00001d30| 6c 64 20 77 69 6c 6c 20 | 68 61 76 65 20 7a 65 72 |ld will |have zer|
|00001d40| 6f 73 20 69 6e 20 74 68 | 65 20 75 70 70 65 72 20 |os in th|e upper |
|00001d50| 31 36 20 62 69 74 73 2e | 0a 0a 45 58 49 54 20 43 |16 bits.|..EXIT C|
|00001d60| 4f 44 45 53 3a 0a 0a 47 | 45 4d 44 4f 53 2c 20 6c |ODES:..G|EMDOS, l|
|00001d70| 69 6b 65 20 4d 53 2d 44 | 4f 53 20 62 65 66 6f 72 |ike MS-D|OS befor|
|00001d80| 65 20 69 74 2c 20 61 6c | 6c 6f 77 73 20 70 72 6f |e it, al|lows pro|
|00001d90| 67 72 61 6d 73 20 74 6f | 20 72 65 74 75 72 6e 20 |grams to| return |
|00001da0| 61 20 31 36 2d 62 69 74 | 20 65 78 69 74 0a 63 6f |a 16-bit| exit.co|
|00001db0| 64 65 20 74 6f 20 74 68 | 65 69 72 20 70 61 72 65 |de to th|eir pare|
|00001dc0| 6e 74 73 20 77 68 65 6e | 20 74 68 65 79 20 74 65 |nts when| they te|
|00001dd0| 72 6d 69 6e 61 74 65 2e | 20 20 54 68 69 73 20 69 |rminate.| This i|
|00001de0| 73 20 64 6f 6e 65 20 77 | 69 74 68 20 74 68 65 0a |s done w|ith the.|
|00001df0| 50 74 65 72 6d 28 65 72 | 72 63 6f 64 65 29 20 63 |Pterm(er|rcode) c|
|00001e00| 61 6c 6c 2e 20 20 54 68 | 65 20 76 61 6c 75 65 20 |all. Th|e value |
|00001e10| 69 6e 20 65 72 72 63 6f | 64 65 20 69 73 20 70 61 |in errco|de is pa|
|00001e20| 73 73 65 64 20 74 6f 20 | 74 68 65 20 70 61 72 65 |ssed to |the pare|
|00001e30| 6e 74 0a 61 73 20 74 68 | 65 20 72 65 74 75 72 6e |nt.as th|e return|
|00001e40| 20 76 61 6c 75 65 20 6f | 66 20 74 68 65 20 50 65 | value o|f the Pe|
|00001e50| 78 65 63 20 73 79 73 74 | 65 6d 20 63 61 6c 6c 2e |xec syst|em call.|
|00001e60| 20 20 54 68 65 20 43 20 | 6c 69 62 72 61 72 79 20 | The C |library |
|00001e70| 66 75 6e 63 74 69 6f 6e | 0a 65 78 69 74 28 65 72 |function|.exit(er|
|00001e80| 72 63 6f 64 65 29 20 75 | 73 75 61 6c 6c 79 20 75 |rcode) u|sually u|
|00001e90| 73 65 73 20 74 68 69 73 | 20 63 61 6c 6c 2e 0a 0a |ses this| call...|
|00001ea0| 55 6e 66 6f 72 74 75 6e | 61 74 65 6c 79 2c 20 74 |Unfortun|ately, t|
|00001eb0| 68 65 20 70 65 6f 70 6c | 65 20 77 68 6f 20 77 72 |he peopl|e who wr|
|00001ec0| 6f 74 65 20 74 68 65 20 | 73 74 61 72 74 75 70 20 |ote the |startup |
|00001ed0| 66 69 6c 65 20 66 6f 72 | 20 74 68 65 20 41 6c 63 |file for| the Alc|
|00001ee0| 79 6f 6e 20 43 0a 63 6f | 6d 70 69 6c 65 72 20 64 |yon C.co|mpiler d|
|00001ef0| 69 64 6e 27 74 20 75 73 | 65 20 74 68 69 73 2e 20 |idn't us|e this. |
|00001f00| 20 54 68 65 20 63 6f 6d | 70 69 6c 65 72 20 63 61 | The com|piler ca|
|00001f10| 6c 6c 73 20 65 78 69 74 | 28 29 20 77 69 74 68 20 |lls exit|() with |
|00001f20| 61 6e 20 65 72 72 6f 72 | 20 63 6f 64 65 2c 0a 61 |an error| code,.a|
|00001f30| 6e 64 20 65 78 69 74 28 | 29 20 63 61 6c 6c 73 20 |nd exit(|) calls |
|00001f40| 5f 65 78 69 74 28 29 2c | 20 62 75 74 20 5f 65 78 |_exit(),| but _ex|
|00001f50| 69 74 20 61 6c 77 61 79 | 73 20 75 73 65 73 20 50 |it alway|s uses P|
|00001f60| 74 65 72 6d 30 28 29 2c | 20 77 68 69 63 68 20 72 |term0(),| which r|
|00001f70| 65 74 75 72 6e 73 0a 7a | 65 72 6f 20 61 73 20 74 |eturns.z|ero as t|
|00001f80| 68 65 20 65 78 69 74 20 | 63 6f 64 65 2e 20 20 49 |he exit |code. I|
|00001f90| 20 66 69 78 65 64 20 74 | 68 69 73 20 62 79 20 72 | fixed t|his by r|
|00001fa0| 65 77 72 69 74 69 6e 67 | 20 47 45 4d 53 54 41 52 |ewriting| GEMSTAR|
|00001fb0| 54 2e 53 2c 20 74 68 65 | 20 66 69 6c 65 0a 79 6f |T.S, the| file.yo|
|00001fc0| 75 20 6c 69 6e 6b 20 77 | 69 74 68 20 66 69 72 73 |u link w|ith firs|
|00001fd0| 74 20 77 68 65 6e 20 75 | 73 69 6e 67 20 41 6c 63 |t when u|sing Alc|
|00001fe0| 79 6f 6e 2e 0a 0a 45 76 | 65 6e 20 74 68 6f 75 67 |yon...Ev|en thoug|
|00001ff0| 68 20 6e 65 77 20 70 72 | 6f 67 72 61 6d 73 20 72 |h new pr|ograms r|
|00002000| 65 74 75 72 6e 20 74 68 | 65 20 72 69 67 68 74 20 |eturn th|e right |
|00002010| 65 78 69 74 20 63 6f 64 | 65 2c 20 74 68 65 20 63 |exit cod|e, the c|
|00002020| 6f 6d 70 69 6c 65 72 0a | 69 74 73 65 6c 66 20 73 |ompiler.|itself s|
|00002030| 74 69 6c 6c 20 64 6f 65 | 73 6e 27 74 2e 20 20 57 |till doe|sn't. W|
|00002040| 65 6c 6c 2c 20 49 20 68 | 61 76 65 20 70 61 74 63 |ell, I h|ave patc|
|00002050| 68 65 64 20 74 68 65 20 | 62 69 6e 61 72 69 65 73 |hed the |binaries|
|00002060| 20 6f 66 20 61 6c 6c 20 | 74 68 65 0a 70 61 73 73 | of all |the.pass|
|00002070| 65 73 20 6f 66 20 74 68 | 65 20 63 6f 6d 70 69 6c |es of th|e compil|
|00002080| 65 72 20 73 6f 20 74 68 | 65 79 20 44 4f 2e 20 20 |er so th|ey DO. |
|00002090| 49 74 20 69 73 6e 27 74 | 20 68 61 72 64 2c 20 61 |It isn't| hard, a|
|000020a0| 6e 64 20 49 20 77 69 6c | 6c 20 70 6f 73 74 0a 69 |nd I wil|l post.i|
|000020b0| 6e 73 74 72 75 63 74 69 | 6f 6e 73 20 61 74 20 61 |nstructi|ons at a|
|000020c0| 20 6c 61 74 65 72 20 64 | 61 74 65 20 66 6f 72 20 | later d|ate for |
|000020d0| 64 6f 69 6e 67 20 69 74 | 2e 20 20 49 46 20 59 4f |doing it|. IF YO|
|000020e0| 55 20 44 4f 20 54 48 49 | 53 2c 20 50 4c 45 41 53 |U DO THI|S, PLEAS|
|000020f0| 45 0a 44 4f 4e 27 54 20 | 42 4f 54 48 45 52 20 4f |E.DON'T |BOTHER O|
|00002100| 55 52 20 43 55 53 54 4f | 4d 45 52 20 53 55 50 50 |UR CUSTO|MER SUPP|
|00002110| 4f 52 54 20 50 45 4f 50 | 4c 45 20 49 46 20 49 54 |ORT PEOP|LE IF IT|
|00002120| 20 44 4f 45 53 4e 27 54 | 20 57 4f 52 4b 2e 20 20 | DOESN'T| WORK. |
|00002130| 54 48 45 59 0a 44 4f 4e | 27 54 20 4b 4e 4f 57 20 |THEY.DON|'T KNOW |
|00002140| 41 4e 59 54 48 49 4e 47 | 20 41 42 4f 55 54 20 49 |ANYTHING| ABOUT I|
|00002150| 54 2e 0a 0a 49 20 68 6f | 70 65 20 74 68 61 74 20 |T...I ho|pe that |
|00002160| 74 68 69 73 20 6c 69 74 | 74 6c 65 20 63 6f 6f 6b |this lit|tle cook|
|00002170| 62 6f 6f 6b 20 6d 61 6b | 65 73 20 50 65 78 65 63 |book mak|es Pexec|
|00002180| 20 6c 65 73 73 20 6d 79 | 73 74 65 72 69 6f 75 73 | less my|sterious|
|00002190| 2e 20 20 49 20 68 61 76 | 65 6e 27 74 0a 63 6f 76 |. I hav|en't.cov|
|000021a0| 65 72 65 64 20 73 75 63 | 68 20 74 6f 70 69 63 73 |ered suc|h topics|
|000021b0| 20 61 73 20 74 68 65 20 | 63 72 69 74 69 63 61 6c | as the |critical|
|000021c0| 2d 65 72 72 6f 72 20 61 | 6e 64 20 74 65 72 6d 69 |-error a|nd termi|
|000021d0| 6e 61 74 65 20 76 65 63 | 74 6f 72 73 2c 20 65 76 |nate vec|tors, ev|
|000021e0| 65 6e 20 74 68 6f 75 67 | 68 0a 74 68 65 79 20 61 |en thoug|h.they a|
|000021f0| 72 65 20 69 6e 74 69 6d | 61 74 65 6c 79 20 63 6f |re intim|ately co|
|00002200| 6e 6e 65 63 74 65 64 20 | 77 69 74 68 20 74 68 65 |nnected |with the|
|00002210| 20 69 64 65 61 20 6f 66 | 20 65 78 65 63 27 69 6e | idea of| exec'in|
|00002220| 67 20 63 68 69 6c 64 72 | 65 6e 2e 20 20 41 20 6d |g childr|en. A m|
|00002230| 6f 72 65 0a 63 6f 6d 70 | 6c 65 74 65 20 63 6f 6f |ore.comp|lete coo|
|00002240| 6b 62 6f 6f 6b 20 73 68 | 6f 75 6c 64 20 62 65 20 |kbook sh|ould be |
|00002250| 66 6f 72 74 68 63 6f 6d | 69 6e 67 2e 0a 0a 49 66 |forthcom|ing...If|
|00002260| 20 74 68 65 72 65 20 61 | 72 65 20 61 6e 79 20 65 | there a|re any e|
|00002270| 72 72 6f 72 73 20 6f 72 | 20 67 72 6f 73 73 20 6f |rrors or| gross o|
|00002280| 6d 69 73 73 69 6f 6e 73 | 20 69 6e 20 74 68 65 20 |missions| in the |
|00002290| 61 62 6f 76 65 20 74 65 | 78 74 2c 20 70 6c 65 61 |above te|xt, plea|
|000022a0| 73 65 0a 6c 65 74 20 6d | 65 20 6b 6e 6f 77 20 42 |se.let m|e know B|
|000022b0| 59 20 4d 41 49 4c 20 73 | 6f 20 49 20 63 61 6e 20 |Y MAIL s|o I can |
|000022c0| 63 6f 72 72 65 63 74 20 | 74 68 65 6d 20 63 6f 68 |correct |them coh|
|000022d0| 65 72 65 6e 74 6c 79 2e | 20 20 4c 61 6e 64 6f 6e |erently.| Landon|
|000022e0| 20 69 73 6e 27 74 0a 68 | 65 72 65 20 74 6f 20 63 | isn't.h|ere to c|
|000022f0| 68 65 63 6b 20 6d 79 20 | 73 65 6d 61 6e 74 69 63 |heck my |semantic|
|00002300| 73 2c 20 73 6f 20 49 20 | 6d 61 79 20 68 61 76 65 |s, so I |may have|
|00002310| 20 6d 69 73 73 65 64 20 | 73 6f 6d 65 74 68 69 6e | missed |somethin|
|00002320| 67 2e 20 20 5b 4c 61 6e | 64 6f 6e 0a 69 73 20 6f |g. [Lan|don.is o|
|00002330| 6e 20 76 61 63 61 74 69 | 6f 6e 20 69 6e 20 46 72 |n vacati|on in Fr|
|00002340| 61 6e 63 65 20 75 6e 74 | 69 6c 20 65 61 72 6c 79 |ance unt|il early|
|00002350| 20 53 65 70 74 65 6d 62 | 65 72 2e 5d 0a 0a 2a 2a | Septemb|er.]..**|
|00002360| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002370| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002380| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002390| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000023a0| 2a 2a 0a 0a 43 2e 20 4b | 61 65 72 6e 62 61 63 68 |**..C. K|aernbach|
|000023b0| 27 73 20 71 75 65 73 74 | 69 6f 6e 20 77 61 73 20 |'s quest|ion was |
|000023c0| 77 68 79 20 68 69 73 20 | 61 63 63 65 73 73 6f 72 |why his |accessor|
|000023d0| 79 2c 20 77 68 69 63 68 | 20 62 61 73 69 63 61 6c |y, which| basical|
|000023e0| 6c 79 20 64 69 64 0a 61 | 20 50 65 78 65 63 20 66 |ly did.a| Pexec f|
|000023f0| 72 6f 6d 20 61 20 66 69 | 6c 65 20 73 65 6c 65 63 |rom a fi|le selec|
|00002400| 74 6f 72 2c 20 64 69 64 | 6e 27 74 20 61 6c 77 61 |tor, did|n't alwa|
|00002410| 79 73 20 77 6f 72 6b 2e | 20 20 54 68 65 20 61 6e |ys work.| The an|
|00002420| 73 77 65 72 20 69 73 20 | 74 68 61 74 0a 69 74 20 |swer is |that.it |
|00002430| 77 6f 72 6b 73 20 77 68 | 65 6e 20 75 73 65 64 20 |works wh|en used |
|00002440| 77 69 74 68 69 6e 20 61 | 20 70 72 6f 67 72 61 6d |within a| program|
|00002450| 20 77 68 69 63 68 20 68 | 61 73 20 72 65 74 75 72 | which h|as retur|
|00002460| 6e 65 64 20 65 6e 6f 75 | 67 68 20 6d 65 6d 6f 72 |ned enou|gh memor|
|00002470| 79 20 74 6f 0a 74 68 65 | 20 4f 53 20 66 6f 72 20 |y to.the| OS for |
|00002480| 74 68 65 20 63 68 69 6c | 64 2e 20 20 57 68 79 20 |the chil|d. Why |
|00002490| 6d 69 67 68 74 20 69 74 | 20 62 6f 6d 62 3f 20 20 |might it| bomb? |
|000024a0| 42 65 63 61 75 73 65 20 | 69 66 20 61 20 70 72 6f |Because |if a pro|
|000024b0| 67 72 61 6d 20 68 61 73 | 0a 72 65 74 75 72 6e 65 |gram has|.returne|
|000024c0| 64 20 61 20 2a 6c 69 74 | 74 6c 65 2a 20 6d 65 6d |d a *lit|tle* mem|
|000024d0| 6f 72 79 20 74 6f 20 74 | 68 65 20 4f 53 20 28 6f |ory to t|he OS (o|
|000024e0| 6e 6c 79 20 61 62 6f 75 | 74 20 32 4b 29 2c 20 61 |nly abou|t 2K), a|
|000024f0| 20 62 75 67 20 69 6e 20 | 50 65 78 65 63 20 0a 73 | bug in |Pexec .s|
|00002500| 68 6f 77 73 20 75 70 20 | 74 68 61 74 20 62 72 65 |hows up |that bre|
|00002510| 61 6b 73 20 74 68 65 20 | 6d 65 6d 6f 72 79 20 6d |aks the |memory m|
|00002520| 61 6e 61 67 65 72 2e 20 | 20 41 63 63 65 73 73 6f |anager. | Accesso|
|00002530| 72 69 65 73 20 61 72 65 | 20 73 74 72 61 6e 67 65 |ries are| strange|
|00002540| 20 62 65 61 73 74 73 0a | 61 6e 79 77 61 79 2c 20 | beasts.|anyway, |
|00002550| 73 6f 20 66 6f 72 20 74 | 68 65 20 6d 6f 73 74 20 |so for t|he most |
|00002560| 70 61 72 74 20 63 6f 6d | 62 69 6e 69 6e 67 20 74 |part com|bining t|
|00002570| 77 6f 20 73 74 72 61 6e | 67 65 20 62 65 61 73 74 |wo stran|ge beast|
|00002580| 73 20 28 41 63 63 65 73 | 73 6f 72 69 65 73 0a 61 |s (Acces|sories.a|
|00002590| 6e 64 20 50 65 78 65 63 | 29 20 69 73 20 62 61 64 |nd Pexec|) is bad|
|000025a0| 20 6e 65 77 73 2e 0a 0a | 2f 2d 2d 2d 2d 2d 2d 2d | news...|/-------|
|000025b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000025c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000025d0| 2d 2d 2d 2d 2d 2d 2d 5c | 0a 7c 20 4f 70 69 6e 69 |-------\|.| Opini|
|000025e0| 6f 6e 73 20 65 78 70 72 | 65 73 73 65 64 20 61 62 |ons expr|essed ab|
|000025f0| 6f 76 65 20 64 6f 20 6e | 6f 74 20 6e 65 63 65 73 |ove do n|ot neces|
|00002600| 73 61 72 69 6c 79 20 20 | 7c 20 20 2d 2d 20 41 6c |sarily || -- Al|
|00002610| 6c 61 6e 20 50 72 61 74 | 74 2c 20 41 74 61 72 69 |lan Prat|t, Atari|
|00002620| 20 43 6f 72 70 2e 0a 7c | 20 72 65 66 6c 65 63 74 | Corp..|| reflect|
|00002630| 20 74 68 6f 73 65 20 6f | 66 20 41 74 61 72 69 20 | those o|f Atari |
|00002640| 43 6f 72 70 2e 20 6f 72 | 20 61 6e 79 6f 6e 65 20 |Corp. or| anyone |
|00002650| 65 6c 73 65 2e 20 7c 20 | 20 20 20 20 2e 2e 2e 6c |else. | | ...l|
|00002660| 6c 6c 2d 6c 63 63 21 61 | 74 61 72 69 21 61 70 72 |ll-lcc!a|tari!apr|
|00002670| 61 74 74 0a 5c 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |att.\---|--------|
|00002680| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002690| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000026a0| 2d 2d 2d 2f 20 20 20 20 | 20 20 20 20 28 41 50 52 |---/ | (APR|
|000026b0| 41 54 54 20 6f 6e 20 47 | 45 6e 69 65 29 0a 0a 69 |ATT on G|Enie)..i|
|000026c0| 6e 20 61 72 74 69 63 6c | 65 20 3c 37 36 37 40 73 |n articl|e <767@s|
|000026d0| 61 74 75 72 6e 2e 75 63 | 73 63 2e 65 64 75 3e 2c |aturn.uc|sc.edu>,|
|000026e0| 20 6b 6f 72 65 74 68 40 | 73 73 79 78 2e 75 63 73 | koreth@|ssyx.ucs|
|000026f0| 63 2e 65 64 75 20 28 53 | 74 65 76 65 6e 20 47 72 |c.edu (S|teven Gr|
|00002700| 69 6d 6d 29 20 73 61 79 | 73 3a 0a 3e 20 23 69 6e |imm) say|s:.> #in|
|00002710| 63 6c 75 64 65 20 3c 6f | 73 62 69 6e 64 2e 68 3e |clude <o|sbind.h>|
|00002720| 0a 3e 20 0a 3e 20 6d 61 | 69 6e 28 29 0a 3e 20 7b |.> .> ma|in().> {|
|00002730| 0a 3e 20 20 20 20 20 20 | 20 6c 6f 6e 67 20 62 61 |.> | long ba|
|00002740| 73 65 70 61 67 65 3b 0a | 3e 20 0a 3e 20 20 20 20 |sepage;.|> .> |
|00002750| 20 20 20 62 61 73 65 70 | 61 67 65 20 3d 20 50 65 | basep|age = Pe|
|00002760| 78 65 63 28 33 2c 20 22 | 74 65 73 74 2e 74 6f 73 |xec(3, "|test.tos|
|00002770| 22 2c 20 22 22 2c 20 30 | 4c 29 3b 0a 3e 20 20 20 |", "", 0|L);.> |
|00002780| 20 20 20 20 70 72 69 6e | 74 66 28 22 62 61 73 65 | prin|tf("base|
|00002790| 70 61 67 65 20 3d 20 25 | 30 38 6c 78 5c 6e 22 2c |page = %|08lx\n",|
|000027a0| 20 62 61 73 65 70 61 67 | 65 29 3b 0a 3e 20 20 20 | basepag|e);.> |
|000027b0| 20 20 20 20 50 65 78 65 | 63 28 34 2c 20 30 4c 2c | Pexe|c(4, 0L,|
|000027c0| 20 30 4c 2c 20 62 61 73 | 65 70 61 67 65 29 3b 0a | 0L, bas|epage);.|
|000027d0| 3e 20 20 20 20 20 20 20 | 70 72 69 6e 74 66 28 22 |> |printf("|
|000027e0| 64 6f 6e 65 5c 6e 22 29 | 3b 0a 3e 20 7d 0a 0a 54 |done\n")|;.> }..T|
|000027f0| 68 65 20 63 6f 72 72 65 | 63 74 20 63 61 6c 6c 20 |he corre|ct call |
|00002800| 66 6f 72 20 50 65 78 65 | 63 20 74 79 70 65 20 34 |for Pexe|c type 4|
|00002810| 20 69 73 20 22 50 65 78 | 65 63 28 34 2c 30 4c 2c | is "Pex|ec(4,0L,|
|00002820| 62 61 73 65 70 61 67 65 | 2c 30 4c 29 3b 22 0a 0a |basepage|,0L);"..|
|00002830| 54 68 65 20 63 6f 6d 62 | 69 6e 61 74 69 6f 6e 20 |The comb|ination |
|00002840| 6f 66 20 6c 6f 61 64 2f | 6e 6f 67 6f 20 70 6c 75 |of load/|nogo plu|
|00002850| 73 20 6a 75 73 74 2d 67 | 6f 20 64 6f 65 73 20 6e |s just-g|o does n|
|00002860| 6f 74 20 77 6f 72 6b 20 | 72 65 6c 69 61 62 6c 79 |ot work |reliably|
|00002870| 2e 0a 54 68 65 72 65 20 | 61 72 65 20 62 75 67 73 |..There |are bugs|
|00002880| 20 69 6e 20 50 65 78 65 | 63 20 72 65 6c 61 74 69 | in Pexe|c relati|
|00002890| 6e 67 20 74 6f 20 6d 65 | 6d 6f 72 79 20 6f 77 6e |ng to me|mory own|
|000028a0| 65 72 73 68 69 70 20 77 | 68 69 63 68 20 63 61 75 |ership w|hich cau|
|000028b0| 73 65 20 74 72 6f 75 62 | 6c 65 2e 0a 0a 59 6f 75 |se troub|le...You|
|000028c0| 20 73 68 6f 75 6c 64 20 | 62 65 20 61 62 6c 65 20 | should |be able |
|000028d0| 74 6f 20 64 65 74 65 72 | 6d 69 6e 65 20 73 6f 6d |to deter|mine som|
|000028e0| 65 74 68 69 6e 67 20 61 | 62 6f 75 74 20 77 68 65 |ething a|bout whe|
|000028f0| 72 65 20 74 68 65 20 62 | 6f 6d 62 73 20 61 72 65 |re the b|ombs are|
|00002900| 2c 0a 74 68 6f 75 67 68 | 3a 20 69 73 20 74 68 65 |,.though|: is the|
|00002910| 20 50 43 20 69 6e 20 52 | 4f 4d 2c 20 6f 72 20 6c | PC in R|OM, or l|
|00002920| 65 73 73 20 74 68 61 6e | 20 22 62 61 73 65 70 61 |ess than| "basepa|
|00002930| 67 65 22 20 28 69 2e 65 | 2e 20 69 6e 20 74 68 65 |ge" (i.e|. in the|
|00002940| 20 70 61 72 65 6e 74 29 | 2c 0a 6f 72 20 67 72 65 | parent)|,.or gre|
|00002950| 61 74 65 72 20 74 68 61 | 6e 20 62 61 73 65 70 61 |ater tha|n basepa|
|00002960| 67 65 20 28 69 2e 65 2e | 20 69 6e 20 74 68 65 20 |ge (i.e.| in the |
|00002970| 63 68 69 6c 64 29 3f 0a | 0a 49 20 68 61 76 65 20 |child)?.|.I have |
|00002980| 61 20 74 72 69 63 6b 20 | 77 68 69 63 68 20 2a 64 |a trick |which *d|
|00002990| 6f 65 73 2a 20 77 6f 72 | 6b 20 66 6f 72 20 66 6f |oes* wor|k for fo|
|000029a0| 6f 6c 69 6e 67 20 77 69 | 74 68 20 61 20 63 68 69 |oling wi|th a chi|
|000029b0| 6c 64 20 62 65 66 6f 72 | 65 20 69 74 20 68 61 73 |ld befor|e it has|
|000029c0| 0a 73 74 61 72 74 65 64 | 20 65 78 65 63 75 74 69 |.started| executi|
|000029d0| 6e 67 2c 20 62 75 74 20 | 69 74 20 69 73 20 75 67 |ng, but |it is ug|
|000029e0| 6c 79 2e 20 20 49 20 75 | 73 65 20 69 74 20 69 6e |ly. I u|se it in|
|000029f0| 20 6d 79 20 64 65 62 75 | 67 67 65 72 2e 20 20 57 | my debu|gger. W|
|00002a00| 68 61 74 20 61 72 65 0a | 79 6f 75 20 74 72 79 69 |hat are.|you tryi|
|00002a10| 6e 67 20 74 6f 20 64 6f | 3f 20 20 4d 61 79 62 65 |ng to do|? Maybe|
|00002a20| 20 74 68 65 20 73 61 6d | 65 20 74 72 69 63 6b 20 | the sam|e trick |
|00002a30| 77 6f 75 6c 64 20 77 6f | 72 6b 20 66 6f 72 20 79 |would wo|rk for y|
|00002a40| 6f 75 2e 20 20 4d 61 69 | 6c 20 6d 65 20 6d 6f 72 |ou. Mai|l me mor|
|00002a50| 65 0a 65 78 70 6c 61 6e | 61 74 69 6f 6e 2e 0a 0a |e.explan|ation...|
|00002a60| 2f 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/-------|--------|
|00002a70| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002a80| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 5c |--------|-------\|
|00002a90| 0a 7c 20 4f 70 69 6e 69 | 6f 6e 73 20 65 78 70 72 |.| Opini|ons expr|
|00002aa0| 65 73 73 65 64 20 61 62 | 6f 76 65 20 64 6f 20 6e |essed ab|ove do n|
|00002ab0| 6f 74 20 6e 65 63 65 73 | 73 61 72 69 6c 79 20 20 |ot neces|sarily |
|00002ac0| 7c 20 20 2d 2d 20 41 6c | 6c 61 6e 20 50 72 61 74 || -- Al|lan Prat|
|00002ad0| 74 2c 20 41 74 61 72 69 | 20 43 6f 72 70 2e 0a 7c |t, Atari| Corp..||
|00002ae0| 20 72 65 66 6c 65 63 74 | 20 74 68 6f 73 65 20 6f | reflect| those o|
|00002af0| 66 20 41 74 61 72 69 20 | 43 6f 72 70 2e 20 6f 72 |f Atari |Corp. or|
|00002b00| 20 61 6e 79 6f 6e 65 20 | 65 6c 73 65 2e 20 7c 20 | anyone |else. | |
|00002b10| 20 20 20 20 2e 2e 2e 6c | 6c 6c 2d 6c 63 63 21 61 | ...l|ll-lcc!a|
|00002b20| 74 61 72 69 21 61 70 72 | 61 74 74 0a 5c 2d 2d 2d |tari!apr|att.\---|
|00002b30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002b40| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002b50| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2f 0a 0a 69 6e |--------|---/..in|
|00002b60| 20 61 72 74 69 63 6c 65 | 20 3c 31 33 32 32 40 64 | article| <1322@d|
|00002b70| 61 73 79 73 31 2e 55 55 | 43 50 3e 2c 20 73 74 65 |asys1.UU|CP>, ste|
|00002b80| 76 65 66 40 64 61 73 79 | 73 31 2e 55 55 43 50 20 |vef@dasy|s1.UUCP |
|00002b90| 28 53 74 65 76 65 20 41 | 2e 20 46 65 69 6e 73 74 |(Steve A|. Feinst|
|00002ba0| 65 69 6e 29 20 73 61 79 | 73 3a 0a 3e 20 44 6f 65 |ein) say|s:.> Doe|
|00002bb0| 73 20 61 6e 79 6f 6e 65 | 20 6b 6e 6f 77 0a 3e 20 |s anyone| know.> |
|00002bc0| 69 66 20 74 68 65 72 65 | 20 69 73 20 61 6e 79 77 |if there| is anyw|
|00002bd0| 61 79 20 74 6f 2c 20 73 | 61 79 20 6c 6f 61 64 20 |ay to, s|ay load |
|00002be0| 61 20 70 72 6f 67 72 61 | 6d 20 69 6e 74 6f 20 74 |a progra|m into t|
|00002bf0| 68 65 20 74 6f 70 20 6f | 66 20 74 68 65 20 54 50 |he top o|f the TP|
|00002c00| 41 0a 3e 20 61 6e 64 20 | 65 78 65 63 75 74 65 20 |A.> and |execute |
|00002c10| 69 74 20 75 70 20 74 68 | 65 72 65 2e 20 20 53 6f |it up th|ere. So|
|00002c20| 20 74 68 61 74 20 77 68 | 65 6e 20 69 74 20 65 78 | that wh|en it ex|
|00002c30| 69 74 73 2c 20 74 68 65 | 72 65 20 77 6f 6e 27 74 |its, the|re won't|
|00002c40| 20 62 65 20 61 6e 79 20 | 68 6f 6c 65 73 3f 0a 0a | be any |holes?..|
|00002c50| 54 68 65 72 65 20 69 73 | 20 6f 6e 65 20 77 61 79 |There is| one way|
|00002c60| 20 74 6f 20 64 6f 20 74 | 68 69 73 20 77 69 74 68 | to do t|his with|
|00002c70| 20 50 65 78 65 63 2c 20 | 62 75 74 20 69 74 20 72 | Pexec, |but it r|
|00002c80| 65 71 75 69 72 65 73 20 | 6b 6e 6f 77 69 6e 67 20 |equires |knowing |
|00002c90| 68 6f 77 20 6d 75 63 68 | 0a 6d 65 6d 6f 72 79 20 |how much|.memory |
|00002ca0| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 77 69 6c 6c |the prog|ram will|
|00002cb0| 20 6e 65 65 64 20 28 6c | 6f 74 73 20 6f 66 20 68 | need (l|ots of h|
|00002cc0| 65 75 72 69 73 74 69 63 | 73 20 68 65 72 65 29 2e |euristic|s here).|
|00002cd0| 0a 0a 6c 6f 6e 67 20 74 | 6f 70 50 65 78 65 63 28 |..long t|opPexec(|
|00002ce0| 63 6d 64 2c 61 72 67 73 | 2c 65 6e 76 2c 73 69 7a |cmd,args|,env,siz|
|00002cf0| 65 29 0a 63 68 61 72 20 | 2a 63 6d 64 2c 20 2a 61 |e).char |*cmd, *a|
|00002d00| 72 67 73 2c 20 2a 65 6e | 76 3b 0a 75 6e 73 69 67 |rgs, *en|v;.unsig|
|00002d10| 6e 65 64 20 6c 6f 6e 67 | 20 73 69 7a 65 3b 0a 7b |ned long| size;.{|
|00002d20| 0a 20 20 20 20 20 20 20 | 20 75 6e 73 69 67 6e 65 |. | unsigne|
|00002d30| 64 20 6c 6f 6e 67 20 62 | 6c 6f 63 6b 73 69 7a 65 |d long b|locksize|
|00002d40| 3b 0a 20 20 20 20 20 20 | 20 20 63 68 61 72 20 2a |;. | char *|
|00002d50| 61 64 64 72 3b 0a 20 20 | 20 20 20 20 20 20 6c 6f |addr;. | lo|
|00002d60| 6e 67 20 72 65 74 3b 0a | 0a 20 20 20 20 20 20 20 |ng ret;.|. |
|00002d70| 20 62 6c 6f 63 6b 73 69 | 7a 65 20 3d 20 4d 61 6c | blocksi|ze = Mal|
|00002d80| 6c 6f 63 28 2d 31 4c 29 | 3b 20 20 20 20 20 20 20 |loc(-1L)|; |
|00002d90| 20 2f 2a 20 66 69 6e 64 | 20 6f 75 74 20 73 69 7a | /* find| out siz|
|00002da0| 65 20 6f 66 20 6c 61 72 | 67 65 73 74 20 62 6c 6f |e of lar|gest blo|
|00002db0| 63 6b 20 2a 2f 0a 20 20 | 20 20 20 20 20 20 69 66 |ck */. | if|
|00002dc0| 20 28 62 6c 6f 63 6b 20 | 3c 20 73 69 7a 65 29 20 | (block |< size) |
|00002dd0| 7b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |{. | |
|00002de0| 20 20 72 65 74 75 72 6e | 20 45 4e 53 4d 45 4d 3b | return| ENSMEM;|
|00002df0| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 6c 61 72 | | /* lar|
|00002e00| 67 65 73 74 20 62 6c 6f | 63 6b 20 6e 6f 74 20 62 |gest blo|ck not b|
|00002e10| 69 67 20 65 6e 6f 75 67 | 68 21 20 2a 2f 0a 20 20 |ig enoug|h! */. |
|00002e20| 20 20 20 20 20 20 7d 0a | 20 20 20 20 20 20 20 20 | }.| |
|00002e30| 61 64 64 72 20 3d 20 4d | 61 6c 6c 6f 63 28 62 6c |addr = M|alloc(bl|
|00002e40| 6f 63 6b 73 69 7a 65 29 | 3b 20 20 20 20 20 20 20 |ocksize)|; |
|00002e50| 2f 2a 20 61 6c 6c 6f 63 | 61 74 65 20 74 68 61 74 |/* alloc|ate that|
|00002e60| 20 62 6c 6f 63 6b 20 2a | 2f 0a 20 20 20 20 20 20 | block *|/. |
|00002e70| 20 20 4d 73 68 72 69 6e | 6b 28 61 64 64 72 2c 62 | Mshrin|k(addr,b|
|00002e80| 6c 6f 63 6b 73 69 7a 65 | 2d 73 69 7a 65 29 3b 20 |locksize|-size); |
|00002e90| 20 20 2f 2a 20 73 68 72 | 69 6e 6b 20 69 74 20 62 | /* shr|ink it b|
|00002ea0| 79 20 73 69 7a 65 20 54 | 53 52 20 6e 65 65 64 73 |y size T|SR needs|
|00002eb0| 20 2a 2f 0a 20 20 20 20 | 20 20 20 20 72 65 74 20 | */. | ret |
|00002ec0| 3d 20 50 65 78 65 63 28 | 30 2c 63 6d 64 2c 61 72 |= Pexec(|0,cmd,ar|
|00002ed0| 67 73 2c 65 6e 76 29 3b | 20 20 20 20 2f 2a 20 65 |gs,env);| /* e|
|00002ee0| 78 65 63 20 74 68 65 20 | 54 53 52 20 2a 2f 0a 20 |xec the |TSR */. |
|00002ef0| 20 20 20 20 20 20 20 4d | 66 72 65 65 28 61 64 64 | M|free(add|
|00002f00| 72 29 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |r); | |
|00002f10| 20 20 20 20 20 20 20 2f | 2a 20 66 72 65 65 20 74 | /|* free t|
|00002f20| 68 65 20 70 61 64 64 69 | 6e 67 20 2a 2f 0a 20 20 |he paddi|ng */. |
|00002f30| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 72 65 74 | re|turn ret|
|00002f40| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00002f50| 20 20 20 20 20 20 2f 2a | 20 72 65 74 75 72 6e 20 | /*| return |
|00002f60| 74 68 65 20 65 78 69 74 | 20 63 6f 64 65 20 2a 2f |the exit| code */|
|00002f70| 0a 7d 0a 0a 54 68 69 73 | 20 70 72 6f 63 65 64 75 |.}..This| procedu|
|00002f80| 72 65 20 74 61 6b 65 73 | 20 61 20 22 73 69 7a 65 |re takes| a "size|
|00002f90| 22 20 61 72 67 75 6d 65 | 6e 74 20 77 68 69 63 68 |" argume|nt which|
|00002fa0| 20 69 73 20 74 68 65 20 | 61 6d 6f 75 6e 74 20 6f | is the |amount o|
|00002fb0| 66 20 6d 65 6d 6f 72 79 | 0a 74 68 65 20 70 72 6f |f memory|.the pro|
|00002fc0| 67 72 61 6d 20 69 6e 20 | 71 75 65 73 74 69 6f 6e |gram in |question|
|00002fd0| 20 77 69 6c 6c 20 6e 65 | 65 64 20 66 6f 72 20 69 | will ne|ed for i|
|00002fe0| 74 73 20 74 65 78 74 2c | 20 64 61 74 61 2c 20 62 |ts text,| data, b|
|00002ff0| 73 73 2c 20 62 61 73 65 | 70 61 67 65 2c 0a 65 6e |ss, base|page,.en|
|00003000| 76 69 72 6f 6e 6d 65 6e | 74 2c 20 61 6e 64 20 73 |vironmen|t, and s|
|00003010| 74 61 63 6b 2f 68 65 61 | 70 2e 20 20 54 68 69 73 |tack/hea|p. This|
|00003020| 20 69 73 20 6e 6f 74 20 | 61 20 63 6f 6d 70 75 74 | is not |a comput|
|00003030| 61 62 6c 65 20 6e 75 6d | 62 65 72 3a 20 79 6f 75 |able num|ber: you|
|00003040| 0a 68 61 76 65 20 74 6f | 20 66 69 67 75 72 65 20 |.have to| figure |
|00003050| 69 74 20 6f 75 74 20 65 | 6d 70 69 72 69 63 61 6c |it out e|mpirical|
|00003060| 6c 79 2e 20 20 74 65 78 | 74 2b 64 61 74 61 2b 62 |ly. tex|t+data+b|
|00003070| 73 73 2b 65 6e 76 2b 31 | 30 4b 20 6f 72 20 73 6f |ss+env+1|0K or so|
|00003080| 20 73 68 6f 75 6c 64 0a | 77 6f 72 6b 2c 20 62 75 | should.|work, bu|
|00003090| 74 20 79 6f 75 20 77 69 | 6c 6c 20 61 6c 77 61 79 |t you wi|ll alway|
|000030a0| 73 20 6c 65 61 76 65 20 | 61 20 73 6d 61 6c 6c 20 |s leave |a small |
|000030b0| 68 6f 6c 65 20 61 74 20 | 74 68 65 20 74 6f 70 20 |hole at |the top |
|000030c0| 6f 66 20 6d 65 6d 6f 72 | 79 2c 0a 62 65 63 61 75 |of memor|y,.becau|
|000030d0| 73 65 20 54 53 52 27 73 | 20 61 6c 77 61 79 73 20 |se TSR's| always |
|000030e0| 4d 73 68 72 69 6e 6b 20 | 61 20 6c 69 74 74 6c 65 |Mshrink |a little|
|000030f0| 20 62 69 74 2e 0a 0a 3d | 3d 3d 3d 3d 3d 3d 3d 3d | bit...=|========|
|00003100| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00003110| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00003120| 3d 3d 3d 0a 4f 70 69 6e | 69 6f 6e 73 20 65 78 70 |===.Opin|ions exp|
|00003130| 72 65 73 73 65 64 20 61 | 62 6f 76 65 20 64 6f 20 |ressed a|bove do |
|00003140| 6e 6f 74 20 6e 65 63 65 | 73 73 61 72 69 6c 79 20 |not nece|ssarily |
|00003150| 20 20 20 20 2d 2d 20 41 | 6c 6c 61 6e 20 50 72 61 | -- A|llan Pra|
|00003160| 74 74 2c 20 41 74 61 72 | 69 20 43 6f 72 70 2e 0a |tt, Atar|i Corp..|
|00003170| 72 65 66 6c 65 63 74 20 | 74 68 6f 73 65 20 6f 66 |reflect |those of|
|00003180| 20 41 74 61 72 69 20 43 | 6f 72 70 2e 20 6f 72 20 | Atari C|orp. or |
|00003190| 61 6e 79 6f 6e 65 20 65 | 6c 73 65 2e 20 20 20 20 |anyone e|lse. |
|000031a0| 20 20 2e 2e 2e 61 6d 65 | 73 21 61 74 61 72 69 21 | ...ame|s!atari!|
|000031b0| 61 70 72 61 74 74 0a 3d | 3d 3d 3d 3d 3d 3d 3d 3d |apratt.=|========|
|000031c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000031d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000031e0| 3d 3d 3d 0a 0a 0a 41 74 | 74 65 6e 74 69 6f 6e 20 |===...At|tention |
|000031f0| 4d 61 72 6b 20 57 69 6c | 6c 69 61 6d 73 2c 20 42 |Mark Wil|liams, B|
|00003200| 65 63 6b 6d 65 79 65 72 | 2c 20 61 6e 64 20 47 65 |eckmeyer|, and Ge|
|00003210| 72 74 20 50 6f 6c 74 69 | 65 6b 2c 20 61 6e 64 20 |rt Polti|ek, and |
|00003220| 61 6e 79 62 6f 64 79 0a | 65 6c 73 65 20 69 6e 74 |anybody.|else int|
|00003230| 65 72 65 73 74 65 64 3a | 0a 0a 54 68 65 72 65 20 |erested:|..There |
|00003240| 69 73 20 61 20 74 72 69 | 63 6b 20 74 68 61 74 20 |is a tri|ck that |
|00003250| 73 6f 6d 65 20 73 68 65 | 6c 6c 73 20 61 6e 64 20 |some she|lls and |
|00003260| 63 6f 6d 70 69 6c 65 72 | 20 6c 69 62 72 61 72 69 |compiler| librari|
|00003270| 65 73 20 75 73 65 20 74 | 68 61 74 20 6c 65 74 73 |es use t|hat lets|
|00003280| 0a 79 6f 75 20 70 61 73 | 73 20 61 72 67 75 6d 65 |.you pas|s argume|
|00003290| 6e 74 20 73 74 72 69 6e | 67 73 20 74 6f 20 70 72 |nt strin|gs to pr|
|000032a0| 6f 67 72 61 6d 73 20 77 | 68 69 63 68 20 61 72 65 |ograms w|hich are|
|000032b0| 20 6c 6f 6e 67 65 72 20 | 74 68 61 6e 20 74 68 65 | longer |than the|
|000032c0| 20 31 32 37 0a 62 79 74 | 65 73 20 77 68 69 63 68 | 127.byt|es which|
|000032d0| 20 66 69 74 20 69 6e 20 | 74 68 65 20 63 6f 6d 6d | fit in |the comm|
|000032e0| 61 6e 64 20 6c 69 6e 65 | 20 61 72 65 61 20 6f 66 |and line| area of|
|000032f0| 20 74 68 65 20 62 61 73 | 65 70 61 67 65 2e 20 20 | the bas|epage. |
|00003300| 54 68 65 69 72 20 74 72 | 69 63 6b 0a 69 73 20 74 |Their tr|ick.is t|
|00003310| 6f 20 70 75 74 20 74 68 | 65 20 77 6f 72 64 20 41 |o put th|e word A|
|00003320| 52 47 56 3d 20 69 6e 20 | 74 68 65 20 65 6e 76 69 |RGV= in |the envi|
|00003330| 72 6f 6e 6d 65 6e 74 2c | 20 61 6e 64 20 66 6f 6c |ronment,| and fol|
|00003340| 6c 6f 77 20 69 74 20 77 | 69 74 68 20 61 0a 6e 75 |low it w|ith a.nu|
|00003350| 6c 6c 2d 73 65 70 61 72 | 61 74 65 64 20 6c 69 73 |ll-separ|ated lis|
|00003360| 74 20 6f 66 20 61 72 67 | 75 6d 65 6e 74 20 73 74 |t of arg|ument st|
|00003370| 72 69 6e 67 73 2e 20 20 | 54 68 65 20 6c 69 73 74 |rings. |The list|
|00003380| 20 69 73 20 74 65 72 6d | 69 6e 61 74 65 64 20 77 | is term|inated w|
|00003390| 69 74 68 0a 61 6e 6f 74 | 68 65 72 20 6e 75 6c 6c |ith.anot|her null|
|000033a0| 2e 20 0a 0a 54 68 69 73 | 20 73 63 68 65 6d 65 20 |. ..This| scheme |
|000033b0| 77 6f 72 6b 73 20 70 72 | 65 74 74 79 20 77 65 6c |works pr|etty wel|
|000033c0| 6c 2c 20 62 75 74 20 68 | 61 73 20 74 77 6f 20 64 |l, but h|as two d|
|000033d0| 72 61 77 62 61 63 6b 73 | 2c 20 6f 6e 65 20 6d 61 |rawbacks|, one ma|
|000033e0| 6a 6f 72 20 61 6e 64 20 | 6f 6e 65 0a 6d 69 6e 6f |jor and |one.mino|
|000033f0| 72 2e 20 0a 0a 54 68 65 | 20 6d 69 6e 6f 72 20 64 |r. ..The| minor d|
|00003400| 72 61 77 62 61 63 6b 20 | 69 73 20 74 68 61 74 20 |rawback |is that |
|00003410| 69 74 20 64 65 66 69 65 | 73 20 74 68 65 20 64 65 |it defie|s the de|
|00003420| 66 69 6e 69 74 69 6f 6e | 20 6f 66 20 77 68 61 74 |finition| of what|
|00003430| 20 69 73 20 69 6e 20 74 | 68 65 0a 65 6e 76 69 72 | is in t|he.envir|
|00003440| 6f 6e 6d 65 6e 74 3a 20 | 74 68 65 20 65 6e 76 69 |onment: |the envi|
|00003450| 72 6f 6e 6d 65 6e 74 20 | 73 68 6f 75 6c 64 20 63 |ronment |should c|
|00003460| 6f 6e 73 69 73 74 20 6f | 66 20 73 74 72 69 6e 67 |onsist o|f string|
|00003470| 73 20 6f 66 20 74 68 65 | 20 66 6f 72 6d 0a 4e 41 |s of the| form.NA|
|00003480| 4d 45 3d 76 61 6c 75 65 | 3c 4e 55 4c 3e 20 74 65 |ME=value|<NUL> te|
|00003490| 72 6d 69 6e 61 74 65 64 | 20 62 79 20 61 20 66 69 |rminated| by a fi|
|000034a0| 6e 61 6c 20 3c 4e 55 4c | 3e 2e 20 20 54 68 69 73 |nal <NUL|>. This|
|000034b0| 20 69 73 20 6d 69 6e 6f | 72 20 62 65 63 61 75 73 | is mino|r becaus|
|000034c0| 65 0a 73 68 65 6c 6c 73 | 20 75 73 69 6e 67 20 74 |e.shells| using t|
|000034d0| 68 69 73 20 63 6f 6e 76 | 65 6e 74 69 6f 6e 20 75 |his conv|ention u|
|000034e0| 73 75 61 6c 6c 79 20 70 | 75 74 20 74 68 65 20 41 |sually p|ut the A|
|000034f0| 52 47 56 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |RGV info|rmation |
|00003500| 61 74 20 74 68 65 20 65 | 6e 64 0a 6f 66 20 74 68 |at the e|nd.of th|
|00003510| 65 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 20 61 6e |e enviro|nment an|
|00003520| 79 77 61 79 2e 20 0a 0a | 54 68 65 20 6d 61 6a 6f |yway. ..|The majo|
|00003530| 72 20 64 72 61 77 62 61 | 63 6b 20 69 73 20 74 68 |r drawba|ck is th|
|00003540| 61 74 20 79 6f 75 20 63 | 61 6e 27 74 20 74 65 6c |at you c|an't tel|
|00003550| 6c 20 69 66 20 74 68 65 | 20 41 52 47 56 20 73 74 |l if the| ARGV st|
|00003560| 72 69 6e 67 20 69 6e 20 | 79 6f 75 72 0a 65 6e 76 |ring in |your.env|
|00003570| 69 72 6f 6e 6d 65 6e 74 | 20 69 73 20 72 65 61 6c |ironment| is real|
|00003580| 6c 79 20 6d 65 61 6e 74 | 20 66 6f 72 20 79 6f 75 |ly meant| for you|
|00003590| 2e 20 20 49 6d 61 67 69 | 6e 65 20 79 6f 75 20 68 |. Imagi|ne you h|
|000035a0| 61 76 65 20 74 68 65 20 | 4d 61 72 6b 20 57 69 6c |ave the |Mark Wil|
|000035b0| 6c 69 61 6d 73 0a 73 68 | 65 6c 6c 20 28 6d 73 68 |liams.sh|ell (msh|
|000035c0| 29 2c 20 61 6e 20 65 64 | 69 74 6f 72 20 63 6f 6d |), an ed|itor com|
|000035d0| 70 69 6c 65 64 20 77 69 | 74 68 20 41 6c 63 79 6f |piled wi|th Alcyo|
|000035e0| 6e 2c 20 61 6e 64 20 61 | 6e 6f 74 68 65 72 20 75 |n, and a|nother u|
|000035f0| 74 69 6c 69 74 79 20 6c | 69 6b 65 0a 22 65 63 68 |tility l|ike."ech|
|00003600| 6f 22 20 63 6f 6d 70 69 | 6c 65 64 20 77 69 74 68 |o" compi|led with|
|00003610| 20 4d 57 43 2e 20 20 49 | 6d 61 67 69 6e 65 20 66 | MWC. I|magine f|
|00003620| 75 72 74 68 65 72 20 74 | 68 61 74 20 74 68 65 20 |urther t|hat the |
|00003630| 65 64 69 74 6f 72 20 68 | 61 73 20 61 0a 22 73 68 |editor h|as a."sh|
|00003640| 65 6c 6c 2d 65 73 63 61 | 70 65 22 20 63 6f 6d 6d |ell-esca|pe" comm|
|00003650| 61 6e 64 20 74 68 61 74 | 20 6c 65 74 73 20 79 6f |and that| lets yo|
|00003660| 75 20 65 78 65 63 75 74 | 65 20 61 6e 6f 74 68 65 |u execut|e anothe|
|00003670| 72 20 70 72 6f 67 72 61 | 6d 20 66 72 6f 6d 20 77 |r progra|m from w|
|00003680| 69 74 68 69 6e 0a 74 68 | 65 20 65 64 69 74 6f 72 |ithin.th|e editor|
|00003690| 2e 20 0a 0a 44 6f 20 74 | 68 69 73 3a 0a 0a 20 20 |. ..Do t|his:.. |
|000036a0| 20 20 20 20 20 20 46 72 | 6f 6d 20 6d 73 68 20 28 | Fr|om msh (|
|000036b0| 74 68 65 20 4d 57 43 20 | 73 68 65 6c 6c 29 3a 20 |the MWC |shell): |
|000036c0| 73 74 61 72 74 20 75 70 | 20 74 68 65 20 65 64 69 |start up| the edi|
|000036d0| 74 6f 72 20 77 69 74 68 | 20 74 68 65 0a 20 20 20 |tor with| the. |
|000036e0| 20 20 20 20 20 63 6f 6d | 6d 61 6e 64 20 6c 69 6e | com|mand lin|
|000036f0| 65 20 61 72 67 75 6d 65 | 6e 74 73 20 22 74 68 69 |e argume|nts "thi|
|00003700| 73 20 69 73 20 61 20 74 | 65 73 74 2e 22 0a 0a 20 |s is a t|est.".. |
|00003710| 20 20 20 20 20 20 20 54 | 65 6c 6c 20 74 68 65 20 | T|ell the |
|00003720| 65 64 69 74 6f 72 20 74 | 6f 20 65 78 65 63 75 74 |editor t|o execut|
|00003730| 65 20 74 68 65 20 63 6f | 6d 6d 61 6e 64 20 22 65 |e the co|mmand "e|
|00003740| 63 68 6f 20 68 65 6c 6c | 6f 20 77 6f 72 6c 64 2e |cho hell|o world.|
|00003750| 22 0a 0a 20 20 20 20 20 | 20 20 20 54 68 65 20 22 |".. | The "|
|00003760| 65 63 68 6f 22 20 63 6f | 6d 6d 61 6e 64 20 77 69 |echo" co|mmand wi|
|00003770| 6c 6c 20 65 63 68 6f 20 | 22 74 68 69 73 20 69 73 |ll echo |"this is|
|00003780| 20 61 20 74 65 73 74 2c | 22 20 6e 6f 74 0a 20 20 | a test,|" not. |
|00003790| 20 20 20 20 20 20 22 68 | 65 6c 6c 6f 20 77 6f 72 | "h|ello wor|
|000037a0| 6c 64 2e 22 0a 0a 57 68 | 61 74 20 68 61 70 70 65 |ld."..Wh|at happe|
|000037b0| 6e 65 64 20 69 73 20 74 | 68 61 74 20 6d 73 68 20 |ned is t|hat msh |
|000037c0| 70 75 74 20 22 74 68 69 | 73 20 69 73 20 61 20 74 |put "thi|s is a t|
|000037d0| 65 73 74 22 20 69 6e 20 | 74 68 65 20 65 6e 76 69 |est" in |the envi|
|000037e0| 72 6f 6e 6d 65 6e 74 20 | 66 6f 72 0a 74 68 65 20 |ronment |for.the |
|000037f0| 65 64 69 74 6f 72 20 28 | 61 73 20 77 65 6c 6c 20 |editor (|as well |
|00003800| 61 73 20 69 6e 20 74 68 | 65 20 63 6f 6d 6d 61 6e |as in th|e comman|
|00003810| 64 20 74 61 69 6c 20 69 | 6e 20 74 68 65 20 62 61 |d tail i|n the ba|
|00003820| 73 65 70 61 67 65 29 2e | 20 20 54 68 65 0a 65 64 |sepage).| The.ed|
|00003830| 69 74 6f 72 2c 20 6e 6f | 74 20 6b 6e 6f 77 69 6e |itor, no|t knowin|
|00003840| 67 20 61 6e 79 20 62 65 | 74 74 65 72 2c 20 64 69 |g any be|tter, di|
|00003850| 64 6e 27 74 20 70 75 74 | 20 22 68 65 6c 6c 6f 20 |dn't put| "hello |
|00003860| 77 6f 72 6c 64 22 20 69 | 6e 20 74 68 65 0a 65 6e |world" i|n the.en|
|00003870| 76 69 72 6f 6e 6d 65 6e | 74 20 62 65 66 6f 72 65 |vironmen|t before|
|00003880| 20 65 78 65 63 75 74 69 | 6e 67 20 22 65 63 68 6f | executi|ng "echo|
|00003890| 2e 22 20 57 68 65 6e 20 | 22 65 63 68 6f 22 20 73 |." When |"echo" s|
|000038a0| 74 61 72 74 65 64 2c 20 | 69 74 20 66 6f 75 6e 64 |tarted, |it found|
|000038b0| 0a 22 41 52 47 56 3d 74 | 68 69 73 20 69 73 20 61 |."ARGV=t|his is a|
|000038c0| 20 74 65 73 74 22 20 69 | 6e 20 69 74 73 20 65 6e | test" i|n its en|
|000038d0| 76 69 72 6f 6e 6d 65 6e | 74 20 61 6e 64 20 65 63 |vironmen|t and ec|
|000038e0| 68 6f 65 64 20 74 68 61 | 74 2e 20 0a 0a 57 68 61 |hoed tha|t. ..Wha|
|000038f0| 74 20 69 73 20 6e 65 65 | 64 65 64 20 69 73 20 61 |t is nee|ded is a|
|00003900| 20 77 61 79 20 66 6f 72 | 20 61 20 70 72 6f 67 72 | way for| a progr|
|00003910| 61 6d 20 74 6f 20 74 65 | 6c 6c 20 69 66 20 74 68 |am to te|ll if th|
|00003920| 65 20 22 41 52 47 56 3d | 22 20 73 74 72 69 6e 67 |e "ARGV=|" string|
|00003930| 20 69 6e 0a 69 74 73 20 | 65 6e 76 69 72 6f 6e 6d | in.its |environm|
|00003940| 65 6e 74 20 69 73 20 72 | 65 61 6c 6c 79 20 69 6e |ent is r|eally in|
|00003950| 74 65 6e 64 65 64 20 66 | 6f 72 20 69 74 2c 20 6f |tended f|or it, o|
|00003960| 72 20 69 73 20 6a 75 73 | 74 20 6c 65 66 74 20 6f |r is jus|t left o|
|00003970| 76 65 72 20 66 72 6f 6d | 20 61 6e 0a 65 61 72 6c |ver from| an.earl|
|00003980| 69 65 72 20 70 72 6f 67 | 72 61 6d 2e 20 20 54 68 |ier prog|ram. Th|
|00003990| 65 72 65 20 69 73 20 61 | 20 77 61 79 20 74 6f 20 |ere is a| way to |
|000039a0| 64 6f 20 74 68 69 73 20 | 74 68 61 74 20 64 6f 65 |do this |that doe|
|000039b0| 73 6e 27 74 20 61 66 66 | 65 63 74 20 6f 6c 64 0a |sn't aff|ect old.|
|000039c0| 70 72 6f 67 72 61 6d 73 | 20 63 6f 6d 70 69 6c 65 |programs| compile|
|000039d0| 64 20 77 69 74 68 6f 75 | 74 20 74 68 69 73 20 66 |d withou|t this f|
|000039e0| 69 78 2e 20 0a 0a 54 68 | 65 20 6e 65 77 20 63 6f |ix. ..Th|e new co|
|000039f0| 6e 76 65 6e 74 69 6f 6e | 20 63 6f 75 6c 64 20 62 |nvention| could b|
|00003a00| 65 20 74 6f 20 70 6c 61 | 63 65 20 61 6e 6f 74 68 |e to pla|ce anoth|
|00003a10| 65 72 20 73 74 72 69 6e | 67 20 69 6e 20 74 68 65 |er strin|g in the|
|00003a20| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 0a 77 69 74 | environ|ment.wit|
|00003a30| 68 20 79 6f 75 72 20 6f | 77 6e 20 62 61 73 65 70 |h your o|wn basep|
|00003a40| 61 67 65 20 61 64 64 72 | 65 73 73 2c 20 62 65 66 |age addr|ess, bef|
|00003a50| 6f 72 65 20 50 65 78 65 | 63 27 69 6e 67 20 79 6f |ore Pexe|c'ing yo|
|00003a60| 75 72 20 63 68 69 6c 64 | 2e 20 20 54 68 65 20 63 |ur child|. The c|
|00003a70| 68 69 6c 64 0a 63 6f 75 | 6c 64 20 73 74 61 72 74 |hild.cou|ld start|
|00003a80| 20 75 70 2c 20 61 6e 64 | 20 63 68 65 63 6b 20 74 | up, and| check t|
|00003a90| 6f 20 73 65 65 20 69 66 | 20 69 74 73 20 70 61 72 |o see if| its par|
|00003aa0| 65 6e 74 27 73 20 62 61 | 73 65 70 61 67 65 20 61 |ent's ba|sepage a|
|00003ab0| 64 64 72 65 73 73 20 28 | 69 6e 0a 69 74 73 20 62 |ddress (|in.its b|
|00003ac0| 61 73 65 70 61 67 65 29 | 20 6d 61 74 63 68 65 73 |asepage)| matches|
|00003ad0| 20 74 68 65 20 61 64 64 | 72 65 73 73 20 69 6e 20 | the add|ress in |
|00003ae0| 74 68 65 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 2e |the envi|ronment.|
|00003af0| 20 20 49 66 20 69 74 20 | 64 6f 65 73 20 6d 61 74 | If it |does mat|
|00003b00| 63 68 2c 0a 74 68 65 20 | 63 68 69 6c 64 20 77 69 |ch,.the |child wi|
|00003b10| 6c 6c 20 6b 6e 6f 77 20 | 74 68 61 74 20 74 68 65 |ll know |that the|
|00003b20| 20 41 52 47 56 3d 20 73 | 74 72 69 6e 67 20 69 73 | ARGV= s|tring is|
|00003b30| 20 66 6f 72 20 69 74 2e | 20 20 49 66 20 69 74 20 | for it.| If it |
|00003b40| 64 6f 65 73 6e 27 74 0a | 6d 61 74 63 68 2c 20 74 |doesn't.|match, t|
|00003b50| 68 65 20 63 68 69 6c 64 | 20 77 69 6c 6c 20 6b 6e |he child| will kn|
|00003b60| 6f 77 20 69 74 20 77 61 | 73 20 73 74 61 72 74 65 |ow it wa|s starte|
|00003b70| 64 20 66 72 6f 6d 20 61 | 20 6e 6f 6e 2d 4d 57 43 |d from a| non-MWC|
|00003b80| 20 70 72 6f 67 72 61 6d | 20 6c 69 6b 65 0a 74 68 | program| like.th|
|00003b90| 65 20 65 64 69 74 6f 72 | 20 61 62 6f 76 65 2c 20 |e editor| above, |
|00003ba0| 61 6e 64 20 77 69 6c 6c | 20 6c 6f 6f 6b 20 69 6e |and will| look in|
|00003bb0| 20 69 74 73 20 62 61 73 | 65 70 61 67 65 20 66 6f | its bas|epage fo|
|00003bc0| 72 20 74 68 65 20 63 6f | 6d 6d 61 6e 64 20 6c 69 |r the co|mmand li|
|00003bd0| 6e 65 2e 20 0a 0a 4e 6f | 74 65 20 74 68 61 74 20 |ne. ..No|te that |
|00003be0| 69 66 20 74 68 65 20 70 | 61 72 65 6e 74 27 73 20 |if the p|arent's |
|00003bf0| 62 61 73 65 70 61 67 65 | 20 69 73 6e 27 74 20 69 |basepage| isn't i|
|00003c00| 6e 20 74 68 65 20 65 6e | 76 69 72 6f 6e 6d 65 6e |n the en|vironmen|
|00003c10| 74 20 61 74 20 61 6c 6c | 2c 20 62 75 74 0a 74 68 |t at all|, but.th|
|00003c20| 65 20 41 52 47 56 3d 20 | 73 74 72 69 6e 67 20 69 |e ARGV= |string i|
|00003c30| 73 2c 20 74 68 65 20 63 | 68 69 6c 64 20 6d 75 73 |s, the c|hild mus|
|00003c40| 74 20 61 73 73 75 6d 65 | 20 74 68 61 74 20 74 68 |t assume| that th|
|00003c50| 65 20 41 52 47 56 20 73 | 74 72 69 6e 67 20 69 73 |e ARGV s|tring is|
|00003c60| 0a 69 6e 74 65 6e 64 65 | 64 20 66 6f 72 20 69 74 |.intende|d for it|
|00003c70| 2c 20 6a 75 73 74 20 61 | 73 20 69 74 20 64 6f 65 |, just a|s it doe|
|00003c80| 73 20 6e 6f 77 2e 20 20 | 54 68 65 72 65 66 6f 72 |s now. |Therefor|
|00003c90| 65 2c 20 6f 6c 64 2d 73 | 74 79 6c 65 20 70 72 6f |e, old-s|tyle pro|
|00003ca0| 67 72 61 6d 73 0a 63 6f | 75 6c 64 20 73 74 69 6c |grams.co|uld stil|
|00003cb0| 6c 20 50 65 78 65 63 20 | 6e 65 77 2d 73 74 79 6c |l Pexec |new-styl|
|00003cc0| 65 20 63 68 69 6c 64 72 | 65 6e 2c 20 61 6e 64 20 |e childr|en, and |
|00003cd0| 76 69 63 65 2d 76 65 72 | 73 61 2e 20 0a 0a 54 68 |vice-ver|sa. ..Th|
|00003ce0| 69 73 20 77 6f 75 6c 64 | 20 61 6c 6c 20 72 65 71 |is would| all req|
|00003cf0| 75 69 72 65 20 61 20 63 | 68 61 6e 67 65 20 69 6e |uire a c|hange in|
|00003d00| 20 74 68 65 20 73 74 61 | 72 74 75 70 20 63 6f 64 | the sta|rtup cod|
|00003d10| 65 20 74 68 61 74 20 63 | 61 6c 6c 73 20 6d 61 69 |e that c|alls mai|
|00003d20| 6e 28 29 2c 0a 61 6e 64 | 20 74 68 65 20 65 78 65 |n(),.and| the exe|
|00003d30| 63 28 29 20 63 6f 64 65 | 20 77 68 69 63 68 20 50 |c() code| which P|
|00003d40| 65 78 65 63 27 73 20 74 | 68 65 20 63 68 69 6c 64 |exec's t|he child|
|00003d50| 2e 20 0a 0a 48 6f 77 20 | 61 62 6f 75 74 20 69 74 |. ..How |about it|
|00003d60| 2c 20 67 75 79 73 3f 20 | 49 66 20 77 65 20 63 6f |, guys? |If we co|
|00003d70| 75 6c 64 20 61 6c 6c 20 | 61 67 72 65 65 20 6f 6e |uld all |agree on|
|00003d80| 20 74 68 65 20 6e 61 6d | 65 20 61 6e 64 20 66 6f | the nam|e and fo|
|00003d90| 72 6d 61 74 20 6f 66 20 | 74 68 69 73 0a 6e 65 77 |rmat of |this.new|
|00003da0| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 20 76 61 72 | environ|ment var|
|00003db0| 69 61 62 6c 65 2c 20 77 | 65 20 63 6f 75 6c 64 20 |iable, w|e could |
|00003dc0| 67 65 74 20 72 69 64 20 | 6f 66 20 61 20 73 65 72 |get rid |of a ser|
|00003dd0| 69 6f 75 73 20 66 6c 61 | 77 20 69 6e 20 4d 61 72 |ious fla|w in Mar|
|00003de0| 6b 0a 57 69 6c 6c 69 61 | 6d 73 27 20 6f 74 68 65 |k.Willia|ms' othe|
|00003df0| 72 77 69 73 65 20 63 6c | 65 76 65 72 20 73 63 68 |rwise cl|ever sch|
|00003e00| 65 6d 65 2e 20 20 4f 74 | 68 65 72 20 73 68 65 6c |eme. Ot|her shel|
|00003e10| 6c 73 20 63 6f 75 6c 64 | 20 61 64 6f 70 74 20 74 |ls could| adopt t|
|00003e20| 68 69 73 2c 20 74 6f 6f | 2c 0a 61 6e 64 20 75 6c |his, too|,.and ul|
|00003e30| 74 69 6d 61 74 65 6c 79 | 20 65 76 65 72 79 62 6f |timately| everybo|
|00003e40| 64 79 20 77 6f 75 6c 64 | 20 62 65 20 61 62 6c 65 |dy would| be able|
|00003e50| 20 74 6f 20 6b 69 73 73 | 20 74 68 65 20 31 32 37 | to kiss| the 127|
|00003e60| 2d 63 68 61 72 61 63 74 | 65 72 0a 63 6f 6d 6d 61 |-charact|er.comma|
|00003e70| 6e 64 2d 6c 69 6e 65 20 | 6c 69 6d 69 74 20 67 6f |nd-line |limit go|
|00003e80| 6f 64 62 79 65 2e 20 0a | 0a 46 6f 72 20 6e 6f 77 |odbye. .|.For now|
|00003e90| 2c 20 49 20 70 72 6f 70 | 6f 73 65 20 74 68 61 74 |, I prop|ose that|
|00003ea0| 20 74 68 65 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 | the env|ironment|
|00003eb0| 20 76 61 72 69 61 62 6c | 65 20 69 6e 20 71 75 65 | variabl|e in que|
|00003ec0| 73 74 69 6f 6e 20 62 65 | 20 63 61 6c 6c 65 64 0a |stion be| called.|
|00003ed0| 50 42 50 2c 20 61 6e 64 | 20 74 68 61 74 20 69 74 |PBP, and| that it|
|00003ee0| 73 20 76 61 6c 75 65 20 | 62 65 20 74 68 65 20 64 |s value |be the d|
|00003ef0| 65 63 69 6d 61 6c 20 73 | 74 72 69 6e 67 20 6f 66 |ecimal s|tring of|
|00003f00| 20 64 69 67 69 74 73 20 | 6d 61 6b 69 6e 67 20 75 | digits |making u|
|00003f10| 70 20 74 68 65 0a 70 61 | 72 65 6e 74 27 73 20 62 |p the.pa|rent's b|
|00003f20| 61 73 65 70 61 67 65 2e | 20 20 54 68 65 20 72 65 |asepage.| The re|
|00003f30| 61 73 6f 6e 20 66 6f 72 | 20 74 68 69 73 20 69 73 |ason for| this is|
|00003f40| 20 74 68 61 74 20 61 6c | 6d 6f 73 74 20 61 6c 6c | that al|most all|
|00003f50| 20 6c 69 62 72 61 72 69 | 65 73 0a 68 61 76 65 20 | librari|es.have |
|00003f60| 61 6e 20 61 74 6f 6c 28 | 29 20 66 75 6e 63 74 69 |an atol(|) functi|
|00003f70| 6f 6e 2c 20 77 68 65 72 | 65 20 6e 6f 74 20 61 6c |on, wher|e not al|
|00003f80| 6c 20 68 61 76 65 20 61 | 6e 20 61 74 6f 6c 78 28 |l have a|n atolx(|
|00003f90| 29 20 66 75 6e 63 74 69 | 6f 6e 2e 20 0a 0a 41 20 |) functi|on. ..A |
|00003fa0| 73 68 65 6c 6c 20 75 73 | 69 6e 67 20 74 68 69 73 |shell us|ing this|
|00003fb0| 20 74 72 69 63 6b 2c 20 | 77 69 74 68 20 61 20 62 | trick, |with a b|
|00003fc0| 61 73 65 70 61 67 65 20 | 61 74 20 33 36 36 34 39 |asepage |at 36649|
|00003fd0| 34 20 28 64 65 63 69 6d | 61 6c 29 2c 20 63 6f 75 |4 (decim|al), cou|
|00003fe0| 6c 64 0a 50 65 78 65 63 | 20 61 20 63 68 69 6c 64 |ld.Pexec| a child|
|00003ff0| 20 63 61 6c 6c 65 64 20 | 22 74 65 73 74 2e 70 72 | called |"test.pr|
|00004000| 67 22 20 77 69 74 68 20 | 74 68 65 73 65 20 73 74 |g" with |these st|
|00004010| 72 69 6e 67 73 20 69 6e | 20 74 68 65 20 65 6e 76 |rings in| the env|
|00004020| 69 72 6f 6e 6d 65 6e 74 | 3a 0a 0a 2e 2e 2e 0a 50 |ironment|:......P|
|00004030| 42 50 3d 33 36 36 34 39 | 34 3c 4e 55 4c 3e 0a 41 |BP=36649|4<NUL>.A|
|00004040| 52 47 56 3d 74 65 73 74 | 2e 70 72 67 3c 4e 55 4c |RGV=test|.prg<NUL|
|00004050| 3e 66 69 72 73 74 3c 4e | 55 4c 3e 73 65 63 6f 6e |>first<N|UL>secon|
|00004060| 64 3c 4e 55 4c 3e 74 68 | 69 72 64 3c 4e 55 4c 3e |d<NUL>th|ird<NUL>|
|00004070| 3c 4e 55 4c 3e 0a 0a 49 | 6e 20 74 68 65 20 73 74 |<NUL>..I|n the st|
|00004080| 61 72 74 75 70 20 63 6f | 64 65 20 6f 66 20 74 68 |artup co|de of th|
|00004090| 65 20 63 68 69 6c 64 2c | 20 79 6f 75 20 77 6f 75 |e child,| you wou|
|000040a0| 6c 64 20 64 6f 20 73 6f | 6d 65 74 68 69 6e 67 20 |ld do so|mething |
|000040b0| 6c 69 6b 65 20 74 68 69 | 73 3a 0a 0a 49 66 20 74 |like thi|s:..If t|
|000040c0| 68 65 72 65 27 73 20 61 | 20 50 42 50 3d 20 69 6e |here's a| PBP= in|
|000040d0| 20 74 68 65 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 | the env|ironment|
|000040e0| 0a 20 20 20 20 20 20 20 | 20 49 66 20 61 74 6f 6c |. | If atol|
|000040f0| 28 50 42 50 29 20 3d 3d | 20 6d 79 20 70 61 72 65 |(PBP) ==| my pare|
|00004100| 6e 74 27 73 20 62 61 73 | 65 70 61 67 65 0a 20 20 |nt's bas|epage. |
|00004110| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 67 65 | | ge|
|00004120| 74 20 61 72 67 73 20 66 | 72 6f 6d 20 65 6e 76 69 |t args f|rom envi|
|00004130| 72 6f 6e 6d 65 6e 74 0a | 20 20 20 20 20 20 20 20 |ronment.| |
|00004140| 65 6c 73 65 0a 20 20 20 | 20 20 20 20 20 20 20 20 |else. | |
|00004150| 20 20 20 20 20 67 65 74 | 20 61 72 67 73 20 66 72 | get| args fr|
|00004160| 6f 6d 20 63 6f 6d 6d 61 | 6e 64 20 6c 69 6e 65 0a |om comma|nd line.|
|00004170| 20 20 20 20 20 20 20 20 | 65 6e 64 69 66 0a 65 6c | |endif.el|
|00004180| 73 65 0a 20 20 20 20 20 | 20 20 20 69 66 20 74 68 |se. | if th|
|00004190| 65 72 65 27 73 20 61 6e | 20 41 52 47 56 3d 20 69 |ere's an| ARGV= i|
|000041a0| 6e 20 74 68 65 20 65 6e | 76 69 72 6f 6e 6d 65 6e |n the en|vironmen|
|000041b0| 74 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |t. | |
|000041c0| 20 20 67 65 74 20 61 72 | 67 73 20 66 72 6f 6d 20 | get ar|gs from |
|000041d0| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 0a 20 20 20 20 |environm|ent. |
|000041e0| 20 20 20 20 65 6c 73 65 | 0a 20 20 20 20 20 20 20 | else|. |
|000041f0| 20 20 20 20 20 20 20 20 | 20 67 65 74 20 61 72 67 | | get arg|
|00004200| 73 20 66 72 6f 6d 20 63 | 6f 6d 6d 61 6e 64 20 6c |s from c|ommand l|
|00004210| 69 6e 65 0a 20 20 20 20 | 20 20 20 20 65 6e 64 69 |ine. | endi|
|00004220| 66 0a 65 6e 64 69 66 0a | 0a 0a 44 6f 65 73 20 74 |f.endif.|..Does t|
|00004230| 68 69 73 20 73 6f 75 6e | 64 20 72 65 61 73 6f 6e |his soun|d reason|
|00004240| 61 62 6c 65 3f 20 49 20 | 77 6f 75 6c 64 20 6c 69 |able? I |would li|
|00004250| 6b 65 20 74 6f 20 73 65 | 65 20 74 68 69 73 20 6b |ke to se|e this k|
|00004260| 69 6e 64 20 6f 66 20 74 | 68 69 6e 67 0a 62 65 63 |ind of t|hing.bec|
|00004270| 6f 6d 65 20 61 20 73 74 | 61 6e 64 61 72 64 2c 20 |ome a st|andard, |
|00004280| 62 75 74 20 75 6e 74 69 | 6c 20 61 20 73 61 66 65 |but unti|l a safe|
|00004290| 67 75 61 72 64 20 6c 69 | 6b 65 20 74 68 69 73 20 |guard li|ke this |
|000042a0| 69 73 20 69 6e 20 70 6c | 61 63 65 2c 20 49 20 63 |is in pl|ace, I c|
|000042b0| 61 6e 27 74 0a 63 6f 6e | 64 6f 6e 65 20 75 73 69 |an't.con|done usi|
|000042c0| 6e 67 20 41 52 47 56 3d | 20 69 6e 20 74 68 65 20 |ng ARGV=| in the |
|000042d0| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 20 66 6f 72 20 |environm|ent for |
|000042e0| 66 69 6e 64 69 6e 67 20 | 79 6f 75 72 20 61 72 67 |finding |your arg|
|000042f0| 75 6d 65 6e 74 73 2e 20 | 20 49 74 27 73 0a 74 6f |uments. | It's.to|
|00004300| 6f 20 63 68 61 6e 63 79 | 20 6a 75 73 74 20 74 6f |o chancy| just to|
|00004310| 20 61 73 73 75 6d 65 20 | 74 68 61 74 20 79 6f 75 | assume |that you|
|00004320| 20 77 65 72 65 20 73 74 | 61 72 74 65 64 20 62 79 | were st|arted by|
|00004330| 20 61 20 70 72 6f 67 72 | 61 6d 20 73 61 76 76 79 | a progr|am savvy|
|00004340| 20 74 6f 0a 74 68 69 73 | 20 73 63 68 65 6d 65 2e | to.this| scheme.|
|00004350| 20 0a 0a 2f 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | ../----|--------|
|00004360| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004370| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004380| 2d 2d 5c 0a 7c 20 4f 70 | 69 6e 69 6f 6e 73 20 65 |--\.| Op|inions e|
|00004390| 78 70 72 65 73 73 65 64 | 20 61 62 6f 76 65 20 64 |xpressed| above d|
|000043a0| 6f 20 6e 6f 74 20 6e 65 | 63 65 73 73 61 72 69 6c |o not ne|cessaril|
|000043b0| 79 20 20 7c 20 20 2d 2d | 20 41 6c 6c 61 6e 20 50 |y | --| Allan P|
|000043c0| 72 61 74 74 2c 20 41 74 | 61 72 69 20 43 6f 72 70 |ratt, At|ari Corp|
|000043d0| 2e 0a 7c 20 72 65 66 6c | 65 63 74 20 74 68 6f 73 |..| refl|ect thos|
|000043e0| 65 20 6f 66 20 41 74 61 | 72 69 20 43 6f 72 70 2e |e of Ata|ri Corp.|
|000043f0| 20 6f 72 20 61 6e 79 6f | 6e 65 20 65 6c 73 65 2e | or anyo|ne else.|
|00004400| 20 7c 20 20 20 20 20 2e | 2e 2e 6c 6c 6c 2d 6c 63 | | .|..lll-lc|
|00004410| 63 21 61 74 61 72 69 21 | 61 70 72 61 74 74 0a 5c |c!atari!|apratt.\|
|00004420| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004430| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004440| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2f 0a |--------|------/.|
|00004450| 0a 0a 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |..======|========|
|00004460| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004470| 3d 3d 3d 3d 3d 3d 20 54 | 68 65 20 45 6e 64 0a 3d |====== T|he End.=|
|00004480| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004490| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000044a0| 3d 3d 3d 0a 0a 0a 2d 2d | 20 0a 41 72 74 69 63 6c |===...--| .Articl|
|000044b0| 65 20 35 34 33 20 6f 66 | 20 63 6f 6d 70 2e 73 79 |e 543 of| comp.sy|
|000044c0| 73 2e 61 74 61 72 69 2e | 73 74 3a 0a 50 61 74 68 |s.atari.|st:.Path|
|000044d0| 3a 0a 75 6e 69 64 6f 21 | 6d 63 76 61 78 21 75 75 |:.unido!|mcvax!uu|
|000044e0| 6e 65 74 21 73 65 69 73 | 6d 6f 21 73 75 6e 64 63 |net!seis|mo!sundc|
|000044f0| 21 70 69 74 73 74 6f 70 | 21 73 75 6e 21 61 6d 64 |!pitstop|!sun!amd|
|00004500| 63 61 64 21 61 6d 65 73 | 21 72 75 74 67 65 72 73 |cad!ames|!rutgers|
|00004510| 21 75 77 76 61 78 21 75 | 6d 6e 0a 6e 2d 64 2d 75 |!uwvax!u|mn.n-d-u|
|00004520| 62 21 75 6d 6e 2d 63 73 | 21 65 6d 73 21 6e 69 73 |b!umn-cs|!ems!nis|
|00004530| 21 73 74 61 67 21 64 61 | 65 6d 6f 6e 0a 3e 46 72 |!stag!da|emon.>Fr|
|00004540| 6f 6d 3a 20 73 79 6e 74 | 65 6c 21 64 61 6c 40 73 |om: synt|el!dal@s|
|00004550| 74 61 67 2e 55 55 43 50 | 20 28 44 61 6c 65 20 53 |tag.UUCP| (Dale S|
|00004560| 63 68 75 6d 61 63 68 65 | 72 29 0a 4e 65 77 73 67 |chumache|r).Newsg|
|00004570| 72 6f 75 70 73 3a 20 63 | 6f 6d 70 2e 73 79 73 2e |roups: c|omp.sys.|
|00004580| 61 74 61 72 69 2e 73 74 | 0a 53 75 62 6a 65 63 74 |atari.st|.Subject|
|00004590| 3a 20 73 68 65 6c 6c 20 | 70 20 75 73 61 67 65 0a |: shell |p usage.|
|000045a0| 4d 65 73 73 61 67 65 2d | 49 44 3a 20 3c 33 32 36 |Message-|ID: <326|
|000045b0| 40 73 74 61 67 2e 55 55 | 43 50 3e 0a 44 61 74 65 |@stag.UU|CP>.Date|
|000045c0| 3a 20 33 20 46 65 62 20 | 38 38 20 31 34 3a 31 37 |: 3 Feb |88 14:17|
|000045d0| 3a 34 36 20 47 4d 54 0a | 41 72 74 69 63 6c 65 2d |:46 GMT.|Article-|
|000045e0| 49 2e 44 2e 3a 20 73 74 | 61 67 2e 33 32 36 0a 50 |I.D.: st|ag.326.P|
|000045f0| 6f 73 74 65 64 3a 20 57 | 65 64 20 46 65 62 20 20 |osted: W|ed Feb |
|00004600| 33 20 31 35 3a 31 37 3a | 34 36 20 31 39 38 38 0a |3 15:17:|46 1988.|
|00004610| 53 65 6e 64 65 72 3a 20 | 64 61 65 6d 6f 6e 40 73 |Sender: |daemon@s|
|00004620| 74 61 67 2e 55 55 43 50 | 0a 4c 69 6e 65 73 3a 20 |tag.UUCP|.Lines: |
|00004630| 31 37 36 0a 0a 0a 20 20 | 3c 64 75 6d 61 73 40 73 |176... |<dumas@s|
|00004640| 75 6d 65 78 2d 61 69 6d | 2e 73 74 61 6e 66 6f 72 |umex-aim|.stanfor|
|00004650| 64 2e 65 64 75 3e 20 77 | 72 69 74 65 73 2e 2e 2e |d.edu> w|rites...|
|00004660| 0a 3e 20 51 75 65 73 74 | 69 6f 6e 20 23 31 20 3a |.> Quest|ion #1 :|
|00004670| 20 48 6f 77 20 4d 57 43 | 27 73 20 6d 73 68 20 69 | How MWC|'s msh i|
|00004680| 73 20 64 69 73 63 6f 76 | 65 72 69 6e 67 20 77 68 |s discov|ering wh|
|00004690| 6f 20 63 61 6c 6c 65 64 | 20 69 74 20 3f 0a 3e 20 |o called| it ?.> |
|000046a0| 20 28 64 65 73 6b 74 6f | 70 2c 20 6f 72 20 6f 74 | (deskto|p, or ot|
|000046b0| 68 65 72 2e 2e 2e 29 20 | 69 74 20 69 73 20 69 6e |her...) |it is in|
|000046c0| 20 74 68 65 20 6c 6f 63 | 61 6c 20 73 68 65 6c 6c | the loc|al shell|
|000046d0| 20 76 61 72 69 61 62 6c | 65 20 27 63 61 6c 6c 65 | variabl|e 'calle|
|000046e0| 64 66 72 6f 6d 27 2e 0a | 3e 20 41 6e 20 6f 74 68 |dfrom'..|> An oth|
|000046f0| 65 72 20 73 68 65 6c 6c | 20 69 73 20 61 62 6c 65 |er shell| is able|
|00004700| 20 74 6f 20 74 65 6c 6c | 20 74 68 65 20 6c 69 73 | to tell| the lis|
|00004710| 74 20 6f 66 20 61 6c 6c | 20 70 61 72 65 6e 74 73 |t of all| parents|
|00004720| 20 70 72 6f 67 72 61 6d | 73 2e 2e 2e 0a 3e 20 54 | program|s....> T|
|00004730| 68 65 20 62 61 73 65 20 | 70 61 67 65 20 64 6f 65 |he base |page doe|
|00004740| 73 20 6e 6f 74 20 63 6f | 6e 74 61 69 6e 20 61 6e |s not co|ntain an|
|00004750| 79 20 62 61 63 6b 77 61 | 72 64 20 70 6f 69 6e 74 |y backwa|rd point|
|00004760| 65 72 2c 20 73 6f 20 77 | 68 61 74 20 69 73 20 69 |er, so w|hat is i|
|00004770| 74 20 3f 0a 0a 49 27 6d | 20 6e 6f 74 20 73 75 72 |t ?..I'm| not sur|
|00004780| 65 20 74 68 61 74 20 4d | 53 48 20 64 6f 65 73 2a |e that M|SH does*|
|00004790| 20 64 65 74 65 63 74 20 | 62 65 69 6e 67 20 63 61 | detect |being ca|
|000047a0| 6c 6c 65 64 20 66 72 6f | 6d 20 74 68 65 20 64 65 |lled fro|m the de|
|000047b0| 73 6b 74 6f 70 2e 20 20 | 57 68 61 74 0a 64 69 66 |sktop. |What.dif|
|000047c0| 66 65 72 65 6e 63 65 20 | 77 6f 75 6c 64 20 69 74 |ference |would it|
|000047d0| 20 6d 61 6b 65 20 28 6f | 72 20 64 6f 65 73 20 69 | make (o|r does i|
|000047e0| 74 20 69 6e 20 4d 53 48 | 29 2e 20 20 54 68 65 20 |t in MSH|). The |
|000047f0| 62 61 73 65 70 61 67 65 | 2c 20 68 6f 77 65 76 65 |basepage|, howeve|
|00004800| 72 2c 0a 44 4f 45 53 2a | 20 63 6f 6e 74 61 69 6e |r,.DOES*| contain|
|00004810| 20 61 20 22 62 61 63 6b | 77 61 72 64 20 70 6f 69 | a "back|ward poi|
|00004820| 6e 74 65 72 22 20 74 6f | 20 74 68 65 20 70 61 72 |nter" to| the par|
|00004830| 65 6e 74 20 70 72 6f 63 | 65 73 73 65 73 20 62 61 |ent proc|esses ba|
|00004840| 73 65 70 61 67 65 2e 0a | 48 65 72 65 20 69 73 20 |sepage..|Here is |
|00004850| 61 20 73 74 72 75 63 74 | 20 74 6f 20 63 6c 61 72 |a struct| to clar|
|00004860| 69 66 79 2e 2e 2e 0a 0a | 74 79 70 65 64 65 66 20 |ify.....|typedef |
|00004870| 73 74 72 75 63 74 0a 20 | 20 20 20 20 20 20 20 7b |struct. | {|
|00004880| 0a 20 20 20 20 20 20 20 | 20 63 68 61 72 20 20 20 |. | char |
|00004890| 20 2a 70 5f 6c 6f 77 74 | 70 61 3b 20 20 20 20 20 | *p_lowt|pa; |
|000048a0| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 70 6f 69 6e | | /* poin|
|000048b0| 74 65 72 20 74 6f 20 73 | 65 6c 66 20 28 62 6f 74 |ter to s|elf (bot|
|000048c0| 74 6f 6d 20 6f 66 20 54 | 50 41 29 20 2a 2f 0a 20 |tom of T|PA) */. |
|000048d0| 20 20 20 20 20 20 20 63 | 68 61 72 20 20 20 20 2a | c|har *|
|000048e0| 70 5f 68 69 74 70 61 3b | 20 20 20 20 20 20 20 20 |p_hitpa;| |
|000048f0| 20 20 20 20 20 20 20 2f | 2a 20 70 6f 69 6e 74 65 | /|* pointe|
|00004900| 72 20 74 6f 20 74 6f 70 | 20 6f 66 20 54 50 41 20 |r to top| of TPA |
|00004910| 2b 20 31 20 2a 2f 0a 20 | 20 20 20 20 20 20 20 63 |+ 1 */. | c|
|00004920| 68 61 72 20 20 20 20 2a | 70 5f 74 62 61 73 65 3b |har *|p_tbase;|
|00004930| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00004940| 2a 20 62 61 73 65 20 6f | 66 20 74 65 78 74 20 73 |* base o|f text s|
|00004950| 65 67 6d 65 6e 74 20 2a | 2f 0a 20 20 20 20 20 20 |egment *|/. |
|00004960| 20 20 6c 6f 6e 67 20 20 | 20 20 70 5f 74 6c 65 6e | long | p_tlen|
|00004970| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00004980| 20 20 2f 2a 20 6c 65 6e | 67 74 68 20 6f 66 20 74 | /* len|gth of t|
|00004990| 65 78 74 20 73 65 67 6d | 65 6e 74 20 2a 2f 0a 20 |ext segm|ent */. |
|000049a0| 20 20 20 20 20 20 20 63 | 68 61 72 20 20 20 20 2a | c|har *|
|000049b0| 70 5f 64 62 61 73 65 3b | 20 20 20 20 20 20 20 20 |p_dbase;| |
|000049c0| 20 20 20 20 20 20 20 2f | 2a 20 62 61 73 65 20 6f | /|* base o|
|000049d0| 66 20 64 61 74 61 20 73 | 65 67 6d 65 6e 74 20 2a |f data s|egment *|
|000049e0| 2f 0a 20 20 20 20 20 20 | 20 20 6c 6f 6e 67 20 20 |/. | long |
|000049f0| 20 20 70 5f 64 6c 65 6e | 3b 20 20 20 20 20 20 20 | p_dlen|; |
|00004a00| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 6c 65 6e | | /* len|
|00004a10| 67 74 68 20 6f 66 20 64 | 61 74 61 20 73 65 67 6d |gth of d|ata segm|
|00004a20| 65 6e 74 20 2a 2f 0a 20 | 20 20 20 20 20 20 20 63 |ent */. | c|
|00004a30| 68 61 72 20 20 20 20 2a | 70 5f 62 62 61 73 65 3b |har *|p_bbase;|
|00004a40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2f | | /|
|00004a50| 2a 20 62 61 73 65 20 6f | 66 20 42 53 53 20 73 65 |* base o|f BSS se|
|00004a60| 67 6d 65 6e 74 20 2a 2f | 0a 20 20 20 20 20 20 20 |gment */|. |
|00004a70| 20 6c 6f 6e 67 20 20 20 | 20 70 5f 62 6c 65 6e 3b | long | p_blen;|
|00004a80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004a90| 20 2f 2a 20 6c 65 6e 67 | 74 68 20 6f 66 20 42 53 | /* leng|th of BS|
|00004aa0| 53 20 73 65 67 6d 65 6e | 74 20 2a 2f 0a 20 20 20 |S segmen|t */. |
|00004ab0| 20 20 20 20 20 63 68 61 | 72 20 20 20 20 2a 70 5f | cha|r *p_|
|00004ac0| 64 74 61 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |dta; | |
|00004ad0| 20 20 20 20 20 2f 2a 20 | 70 6f 69 6e 74 65 72 20 | /* |pointer |
|00004ae0| 74 6f 20 63 75 72 72 65 | 6e 74 20 44 54 41 20 2a |to curre|nt DTA *|
|00004af0| 2f 0a 20 20 20 20 20 20 | 20 20 63 68 61 72 20 20 |/. | char |
|00004b00| 20 20 2a 70 5f 70 61 72 | 65 6e 74 3b 20 20 20 20 | *p_par|ent; |
|00004b10| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 70 6f 69 | | /* poi|
|00004b20| 6e 74 65 72 20 74 6f 20 | 70 61 72 65 6e 74 27 73 |nter to |parent's|
|00004b30| 20 62 61 73 65 70 61 67 | 65 20 2a 2f 0a 20 20 20 | basepag|e */. |
|00004b40| 20 20 20 20 20 63 68 61 | 72 20 20 20 20 2a 70 5f | cha|r *p_|
|00004b50| 72 65 73 65 72 76 65 64 | 3b 20 20 20 20 20 20 20 |reserved|; |
|00004b60| 20 20 20 20 20 2f 2a 20 | 72 65 73 65 72 76 65 64 | /* |reserved|
|00004b70| 20 66 6f 72 20 66 75 74 | 75 72 65 20 75 73 65 20 | for fut|ure use |
|00004b80| 2a 2f 0a 20 20 20 20 20 | 20 20 20 63 68 61 72 20 |*/. | char |
|00004b90| 20 20 20 2a 70 5f 65 6e | 76 3b 20 20 20 20 20 20 | *p_en|v; |
|00004ba0| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 70 6f | | /* po|
|00004bb0| 69 6e 74 65 72 20 74 6f | 20 65 6e 76 69 72 6f 6e |inter to| environ|
|00004bc0| 6d 65 6e 74 20 73 74 72 | 69 6e 67 20 2a 2f 0a 20 |ment str|ing */. |
|00004bd0| 20 20 20 20 20 20 20 6c | 6f 6e 67 20 20 20 20 70 | l|ong p|
|00004be0| 5f 75 6e 64 65 66 69 6e | 65 64 5b 32 30 5d 3b 20 |_undefin|ed[20]; |
|00004bf0| 20 20 20 20 20 20 20 2f | 2a 20 73 63 72 61 74 63 | /|* scratc|
|00004c00| 68 20 61 72 65 61 2e 2e | 2e 20 64 6f 6e 27 74 20 |h area..|. don't |
|00004c10| 74 6f 75 63 68 20 2a 2f | 0a 20 20 20 20 20 20 20 |touch */|. |
|00004c20| 20 63 68 61 72 20 20 20 | 20 70 5f 63 6d 64 6c 69 | char | p_cmdli|
|00004c30| 6e 5b 31 32 38 5d 3b 20 | 20 20 20 20 20 20 20 20 |n[128]; | |
|00004c40| 20 2f 2a 20 63 6f 6d 6d | 61 6e 64 20 6c 69 6e 65 | /* comm|and line|
|00004c50| 20 69 6d 61 67 65 20 2a | 2f 0a 20 20 20 20 20 20 | image *|/. |
|00004c60| 20 20 7d 0a 20 20 20 20 | 20 20 20 20 42 41 53 45 | }. | BASE|
|00004c70| 50 41 47 45 3b 0a 0a 3e | 20 51 75 65 73 74 69 6f |PAGE;..>| Questio|
|00004c80| 6e 20 23 32 20 3a 20 49 | 20 72 65 61 64 20 61 67 |n #2 : I| read ag|
|00004c90| 61 69 6e 20 74 68 65 20 | 64 65 76 20 6b 69 74 20 |ain the |dev kit |
|00004ca0| 64 6f 63 20 6f 6e 20 73 | 68 65 6c 6c 5f 70 2c 20 |doc on s|hell_p, |
|00004cb0| 74 68 65 20 70 6f 73 74 | 69 6e 67 0a 3e 20 62 79 |the post|ing.> by|
|00004cc0| 20 41 2e 50 72 61 74 74 | 20 61 62 6f 75 74 20 69 | A.Pratt| about i|
|00004cd0| 74 2c 20 61 6e 64 20 49 | 20 73 74 69 6c 6c 20 77 |t, and I| still w|
|00004ce0| 6f 6e 64 65 72 20 3a 20 | 77 68 61 74 20 69 73 20 |onder : |what is |
|00004cf0| 69 74 20 3f 0a 3e 20 49 | 20 77 6f 75 6c 64 20 69 |it ?.> I| would i|
|00004d00| 6e 66 65 72 20 69 74 20 | 69 73 20 61 20 70 6f 69 |nfer it |is a poi|
|00004d10| 6e 74 65 72 20 74 6f 20 | 61 20 73 74 72 69 6e 67 |nter to |a string|
|00004d20| 20 74 65 6c 6c 69 6e 67 | 20 74 68 65 20 66 69 6c | telling| the fil|
|00004d30| 65 20 6e 61 6d 65 20 6f | 66 20 61 20 73 68 65 6c |e name o|f a shel|
|00004d40| 6c 2e 2e 2e 0a 3e 20 49 | 20 61 6d 20 72 69 67 68 |l....> I| am righ|
|00004d50| 74 20 3f 0a 3e 20 57 68 | 61 74 20 77 6f 75 6c 64 |t ?.> Wh|at would|
|00004d60| 20 62 65 20 74 68 65 20 | 75 73 65 20 6f 74 68 65 | be the |use othe|
|00004d70| 72 77 69 73 65 20 3f 0a | 0a 54 68 65 20 73 68 65 |rwise ?.|.The she|
|00004d80| 6c 6c 5f 70 20 76 61 72 | 69 61 62 6c 65 2c 20 69 |ll_p var|iable, i|
|00004d90| 66 20 69 74 20 69 73 20 | 76 61 6c 69 64 2c 20 73 |f it is |valid, s|
|00004da0| 68 6f 75 6c 64 20 70 6f | 69 6e 74 20 74 6f 20 61 |hould po|int to a|
|00004db0| 20 72 6f 75 74 69 6e 65 | 20 77 68 69 63 68 0a 77 | routine| which.w|
|00004dc0| 69 6c 6c 20 74 61 6b 65 | 20 61 20 73 74 72 69 6e |ill take| a strin|
|00004dd0| 67 20 61 72 67 75 6d 65 | 6e 74 20 61 6e 64 20 70 |g argume|nt and p|
|00004de0| 72 6f 63 65 73 73 20 69 | 74 20 6c 69 6b 65 20 74 |rocess i|t like t|
|00004df0| 68 65 20 55 6e 2a 78 20 | 73 79 73 74 65 6d 28 29 |he Un*x |system()|
|00004e00| 20 63 61 6c 6c 2e 0a 48 | 65 72 65 20 69 73 20 61 | call..H|ere is a|
|00004e10| 6e 20 65 78 61 6d 70 6c | 65 20 69 6d 70 6c 65 6d |n exampl|e implem|
|00004e20| 65 6e 74 61 74 69 6f 6e | 20 6f 66 20 73 79 73 74 |entation| of syst|
|00004e30| 65 6d 28 29 20 77 68 69 | 63 68 20 74 72 69 65 73 |em() whi|ch tries|
|00004e40| 20 74 6f 20 75 73 65 20 | 74 68 65 0a 73 68 65 6c | to use |the.shel|
|00004e50| 6c 5f 70 20 76 61 72 69 | 61 62 6c 65 2c 20 69 66 |l_p vari|able, if|
|00004e60| 20 70 6f 73 73 69 62 6c | 65 2e 0a 0a 2f 2a 2d 2d | possibl|e.../*--|
|00004e70| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004e80| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004e90| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004ea0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004eb0| 2d 2d 2d 2d 2a 2f 0a 23 | 69 6e 63 6c 75 64 65 20 |----*/.#|include |
|00004ec0| 3c 6f 73 62 69 6e 64 2e | 68 3e 0a 23 69 6e 63 6c |<osbind.|h>.#incl|
|00004ed0| 75 64 65 20 3c 73 74 64 | 69 6f 2e 68 3e 0a 23 69 |ude <std|io.h>.#i|
|00004ee0| 6e 63 6c 75 64 65 20 3c | 73 74 72 69 6e 67 2e 68 |nclude <|string.h|
|00004ef0| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 3c 62 61 73 65 |>.#inclu|de <base|
|00004f00| 70 61 67 65 2e 68 3e 0a | 0a 73 74 61 74 69 63 20 |page.h>.|.static |
|00004f10| 70 61 72 73 65 5f 61 72 | 67 73 28 63 6d 64 6c 6e |parse_ar|gs(cmdln|
|00004f20| 2c 20 61 72 67 76 29 0a | 20 20 20 20 20 20 20 20 |, argv).| |
|00004f30| 63 68 61 72 20 2a 63 6d | 64 6c 6e 3b 0a 20 20 20 |char *cm|dln;. |
|00004f40| 20 20 20 20 20 72 65 67 | 69 73 74 65 72 20 63 68 | reg|ister ch|
|00004f50| 61 72 20 2a 61 72 67 76 | 5b 5d 3b 0a 20 20 20 20 |ar *argv|[];. |
|00004f60| 20 20 20 20 7b 0a 20 20 | 20 20 20 20 20 20 72 65 | {. | re|
|00004f70| 67 69 73 74 65 72 20 63 | 68 61 72 20 2a 70 3b 0a |gister c|har *p;.|
|00004f80| 20 20 20 20 20 20 20 20 | 73 74 61 74 69 63 20 63 | |static c|
|00004f90| 68 61 72 20 64 65 6c 69 | 6d 5b 5d 20 3d 20 22 20 |har deli|m[] = " |
|00004fa0| 5c 74 5c 72 5c 6e 22 3b | 0a 0a 20 20 20 20 20 20 |\t\r\n";|.. |
|00004fb0| 20 20 69 66 28 70 20 3d | 20 73 74 72 74 6f 6b 28 | if(p =| strtok(|
|00004fc0| 63 6d 64 6c 6e 2c 20 64 | 65 6c 69 6d 29 29 0a 20 |cmdln, d|elim)). |
|00004fd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 7b | | {|
|00004fe0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00004ff0| 20 64 6f 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | do. | |
|00005000| 20 20 20 20 20 20 20 20 | 20 20 20 20 7b 0a 20 20 | | {. |
|00005010| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005020| 20 20 20 20 20 20 2a 61 | 72 67 76 2b 2b 20 3d 20 | *a|rgv++ = |
|00005030| 70 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |p;. | |
|00005040| 20 20 20 20 20 20 20 20 | 20 20 20 7d 20 77 68 69 | | } whi|
|00005050| 6c 65 28 70 20 3d 20 73 | 74 72 74 6f 6b 28 4e 55 |le(p = s|trtok(NU|
|00005060| 4c 4c 2c 20 64 65 6c 69 | 6d 29 29 3b 0a 20 20 20 |LL, deli|m));. |
|00005070| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 7d 0a 20 | | }. |
|00005080| 20 20 20 20 20 20 20 7d | 0a 0a 69 6e 74 20 73 79 | }|..int sy|
|00005090| 73 74 65 6d 28 63 6f 6d | 6d 61 6e 64 29 0a 20 20 |stem(com|mand). |
|000050a0| 20 20 20 20 20 20 72 65 | 67 69 73 74 65 72 20 63 | re|gister c|
|000050b0| 68 61 72 20 2a 63 6f 6d | 6d 61 6e 64 3b 0a 2f 2a |har *com|mand;./*|
|000050c0| 0a 20 2a 20 20 20 20 20 | 20 41 74 74 65 6d 70 74 |. * | Attempt|
|000050d0| 73 20 74 6f 20 70 61 73 | 73 20 3c 63 6f 6d 6d 61 |s to pas|s <comma|
|000050e0| 6e 64 3e 20 74 6f 20 74 | 68 65 20 73 68 65 6c 6c |nd> to t|he shell|
|000050f0| 20 70 72 6f 67 72 61 6d | 20 70 6f 69 6e 74 65 64 | program| pointed|
|00005100| 20 74 6f 20 62 79 0a 20 | 2a 20 20 20 20 20 20 74 | to by. |* t|
|00005110| 68 65 20 73 79 73 74 65 | 6d 20 76 61 72 69 61 62 |he syste|m variab|
|00005120| 6c 65 20 22 5f 73 68 65 | 6c 6c 5f 70 22 2e 20 20 |le "_she|ll_p". |
|00005130| 49 66 20 61 20 76 61 6c | 69 64 20 73 68 65 6c 6c |If a val|id shell|
|00005140| 20 63 61 6e 27 74 20 62 | 65 20 66 6f 75 6e 64 0a | can't b|e found.|
|00005150| 20 2a 20 20 20 20 20 20 | 74 68 65 72 65 2c 20 74 | * |there, t|
|00005160| 68 65 20 22 53 48 45 4c | 4c 22 20 65 6e 76 69 72 |he "SHEL|L" envir|
|00005170| 6f 6e 6d 65 6e 74 20 76 | 61 72 69 61 62 6c 65 20 |onment v|ariable |
|00005180| 69 73 20 73 65 61 72 63 | 68 65 64 20 66 6f 72 2e |is searc|hed for.|
|00005190| 20 20 49 66 20 69 74 0a | 20 2a 20 20 20 20 20 20 | If it.| * |
|000051a0| 65 78 69 73 74 73 20 61 | 6e 64 20 69 73 20 6e 6f |exists a|nd is no|
|000051b0| 74 20 65 6d 70 74 79 2c | 20 69 74 20 77 69 6c 6c |t empty,| it will|
|000051c0| 20 62 65 20 74 68 65 20 | 6e 61 6d 65 20 6f 66 20 | be the |name of |
|000051d0| 74 68 65 20 73 68 65 6c | 6c 20 70 72 6f 67 72 61 |the shel|l progra|
|000051e0| 6d 0a 20 2a 20 20 20 20 | 20 20 74 6f 20 65 78 65 |m. * | to exe|
|000051f0| 63 75 74 65 20 74 68 65 | 20 67 69 76 65 6e 20 63 |cute the| given c|
|00005200| 6f 6d 6d 61 6e 64 2e 20 | 20 49 66 20 22 53 48 45 |ommand. | If "SHE|
|00005210| 4c 4c 22 20 69 73 20 6e | 6f 74 20 76 61 6c 69 64 |LL" is n|ot valid|
|00005220| 2c 20 74 68 65 0a 20 2a | 20 20 20 20 20 20 22 50 |, the. *| "P|
|00005230| 41 54 48 22 20 76 61 72 | 69 61 62 6c 65 20 69 73 |ATH" var|iable is|
|00005240| 20 75 73 65 64 20 61 73 | 20 61 20 6c 69 73 74 20 | used as| a list |
|00005250| 6f 66 20 64 69 72 65 63 | 74 6f 72 69 65 73 20 74 |of direc|tories t|
|00005260| 6f 20 73 65 61 72 63 68 | 20 66 6f 72 0a 20 2a 20 |o search| for. * |
|00005270| 20 20 20 20 20 74 68 65 | 20 70 72 6f 67 72 61 6d | the| program|
|00005280| 20 6e 61 6d 65 20 77 68 | 69 63 68 20 69 73 20 74 | name wh|ich is t|
|00005290| 68 65 20 66 69 72 73 74 | 20 74 6f 6b 65 6e 20 6f |he first| token o|
|000052a0| 66 20 74 68 65 20 63 6f | 6d 6d 61 6e 64 2e 20 20 |f the co|mmand. |
|000052b0| 54 68 65 0a 20 2a 20 20 | 20 20 20 20 65 78 74 65 |The. * | exte|
|000052c0| 6e 73 69 6f 6e 73 20 74 | 72 69 65 64 20 28 69 66 |nsions t|ried (if|
|000052d0| 20 6e 6f 6e 65 20 69 73 | 20 73 70 65 63 69 66 69 | none is| specifi|
|000052e0| 65 64 29 20 61 72 65 20 | 22 2e 54 54 50 22 2c 20 |ed) are |".TTP", |
|000052f0| 22 2e 54 4f 53 22 2c 0a | 20 2a 20 20 20 20 20 20 |".TOS",.| * |
|00005300| 22 2e 50 52 47 22 20 61 | 6e 64 20 22 2e 41 50 50 |".PRG" a|nd ".APP|
|00005310| 22 2e 0a 20 2a 2f 0a 7b | 0a 20 20 20 20 20 20 20 |".. */.{|. |
|00005320| 20 72 65 67 69 73 74 65 | 72 20 63 68 61 72 20 2a | registe|r char *|
|00005330| 70 3b 0a 20 20 20 20 20 | 20 20 20 72 65 67 69 73 |p;. | regis|
|00005340| 74 65 72 20 69 6e 74 20 | 28 2a 73 68 65 6c 6c 29 |ter int |(*shell)|
|00005350| 28 29 3b 0a 20 20 20 20 | 20 20 20 20 63 68 61 72 |();. | char|
|00005360| 20 72 76 5b 32 5d 3b 0a | 20 20 20 20 20 20 20 20 | rv[2];.| |
|00005370| 63 68 61 72 20 63 6d 64 | 6c 6e 5b 31 30 32 34 5d |char cmd|ln[1024]|
|00005380| 3b 0a 20 20 20 20 20 20 | 20 20 63 68 61 72 20 2a |;. | char *|
|00005390| 61 72 67 73 5b 36 34 5d | 3b 0a 20 20 20 20 20 20 |args[64]|;. |
|000053a0| 20 20 63 68 61 72 20 2a | 67 65 74 65 6e 76 28 29 | char *|getenv()|
|000053b0| 3b 0a 0a 20 20 20 20 20 | 20 20 20 69 66 28 21 63 |;.. | if(!c|
|000053c0| 6f 6d 6d 61 6e 64 29 0a | 20 20 20 20 20 20 20 20 |ommand).| |
|000053d0| 20 20 20 20 20 20 20 20 | 72 65 74 75 72 6e 28 45 | |return(E|
|000053e0| 52 52 4f 52 29 3b 0a 0a | 20 20 20 20 20 20 20 20 |RROR);..| |
|000053f0| 2f 2a 20 67 65 74 20 5f | 73 68 65 6c 6c 5f 70 20 |/* get _|shell_p |
|00005400| 76 61 6c 75 65 20 2a 2f | 0a 20 20 20 20 20 20 20 |value */|. |
|00005410| 20 70 20 3d 20 53 75 70 | 65 72 28 30 4c 29 3b 0a | p = Sup|er(0L);.|
|00005420| 20 20 20 20 20 20 20 20 | 73 68 65 6c 6c 20 3d 20 | |shell = |
|00005430| 2a 28 28 6c 6f 6e 67 20 | 2a 29 20 30 78 34 46 36 |*((long |*) 0x4F6|
|00005440| 4c 29 3b 0a 20 20 20 20 | 20 20 20 20 53 75 70 65 |L);. | Supe|
|00005450| 72 28 70 29 3b 0a 0a 20 | 20 20 20 20 20 20 20 2f |r(p);.. | /|
|00005460| 2a 20 76 61 6c 69 64 61 | 74 65 20 5f 73 68 65 6c |* valida|te _shel|
|00005470| 6c 5f 70 20 2a 2f 0a 20 | 20 20 20 20 20 20 20 69 |l_p */. | i|
|00005480| 66 28 28 73 68 65 6c 6c | 29 20 26 26 20 20 20 20 |f((shell|) && |
|00005490| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000054a0| 20 20 20 20 20 20 20 2f | 2a 20 53 68 65 6c 6c 20 | /|* Shell |
|000054b0| 61 76 61 69 6c 61 62 6c | 65 2e 20 2a 2f 0a 20 20 |availabl|e. */. |
|000054c0| 20 20 20 20 20 20 20 20 | 20 28 28 28 6c 6f 6e 67 | | (((long|
|000054d0| 29 20 73 68 65 6c 6c 29 | 20 3c 20 28 28 6c 6f 6e |) shell)| < ((lon|
|000054e0| 67 29 20 5f 62 61 73 65 | 29 29 20 26 26 20 2f 2a |g) _base|)) && /*|
|000054f0| 20 52 65 61 73 6f 6e 61 | 62 6c 65 20 73 68 65 6c | Reasona|ble shel|
|00005500| 6c 20 70 6f 69 6e 74 65 | 72 2e 20 2a 2f 0a 20 20 |l pointe|r. */. |
|00005510| 20 20 20 20 20 20 20 20 | 20 28 73 74 72 6e 63 6d | | (strncm|
|00005520| 70 28 73 68 65 6c 6c 2c | 20 22 50 41 54 48 22 2c |p(shell,| "PATH",|
|00005530| 20 34 29 29 29 20 20 20 | 20 20 20 20 20 20 2f 2a | 4))) | /*|
|00005540| 20 4e 6f 74 20 63 6f 72 | 72 75 70 74 65 64 20 2a | Not cor|rupted *|
|00005550| 2f 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |/. | |
|00005560| 20 20 7b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00005570| 20 20 20 20 2f 2a 20 65 | 78 65 63 75 74 65 20 74 | /* e|xecute t|
|00005580| 68 65 20 63 6f 6d 6d 61 | 6e 64 20 2a 2f 0a 20 20 |he comma|nd */. |
|00005590| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 72 65 | | re|
|000055a0| 74 75 72 6e 28 28 2a 73 | 68 65 6c 6c 29 28 63 6f |turn((*s|hell)(co|
|000055b0| 6d 6d 61 6e 64 29 29 3b | 0a 20 20 20 20 20 20 20 |mmand));|. |
|000055c0| 20 20 20 20 20 20 20 20 | 20 7d 0a 0a 20 20 20 20 | | }.. |
|000055d0| 20 20 20 20 2f 2a 20 63 | 6f 70 79 20 74 68 65 20 | /* c|opy the |
|000055e0| 63 6f 6d 6d 61 6e 64 20 | 6c 69 6e 65 20 66 6f 72 |command |line for|
|000055f0| 20 70 61 72 73 69 6e 67 | 20 2a 2f 0a 20 20 20 20 | parsing| */. |
|00005600| 20 20 20 20 73 74 72 63 | 70 79 28 63 6d 64 6c 6e | strc|py(cmdln|
|00005610| 2c 20 63 6f 6d 6d 61 6e | 64 29 3b 0a 0a 20 20 20 |, comman|d);.. |
|00005620| 20 20 20 20 20 2f 2a 20 | 53 48 45 4c 4c 3d 20 76 | /* |SHELL= v|
|00005630| 61 72 69 61 62 6c 65 3f | 20 2a 2f 0a 20 20 20 20 |ariable?| */. |
|00005640| 20 20 20 20 69 66 28 28 | 70 20 3d 20 67 65 74 65 | if((|p = gete|
|00005650| 6e 76 28 22 53 48 45 4c | 4c 22 29 29 20 26 26 20 |nv("SHEL|L")) && |
|00005660| 28 2a 70 29 29 0a 20 20 | 20 20 20 20 20 20 20 20 |(*p)). | |
|00005670| 20 20 20 20 20 20 7b 0a | 20 20 20 20 20 20 20 20 | {.| |
|00005680| 20 20 20 20 20 20 20 20 | 61 72 67 73 5b 30 5d 20 | |args[0] |
|00005690| 3d 20 70 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |= p;. | |
|000056a0| 20 20 20 20 20 70 61 72 | 73 65 5f 61 72 67 73 28 | par|se_args(|
|000056b0| 63 6d 64 6c 6e 2c 20 61 | 72 67 73 2b 31 29 3b 0a |cmdln, a|rgs+1);.|
|000056c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000056d0| 66 6f 72 6b 76 70 65 28 | 70 2c 20 61 72 67 73 2c |forkvpe(|p, args,|
|000056e0| 20 4e 55 4c 4c 29 3b 0a | 20 20 20 20 20 20 20 20 | NULL);.| |
|000056f0| 20 20 20 20 20 20 20 20 | 77 61 69 74 28 26 72 76 | |wait(&rv|
|00005700| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |);. | |
|00005710| 20 20 20 72 65 74 75 72 | 6e 28 28 72 76 5b 31 5d | retur|n((rv[1]|
|00005720| 20 3d 3d 20 30 29 20 3f | 20 72 76 5b 30 5d 20 3a | == 0) ?| rv[0] :|
|00005730| 20 72 76 5b 31 5d 29 3b | 0a 20 20 20 20 20 20 20 | rv[1]);|. |
|00005740| 20 20 20 20 20 20 20 20 | 20 7d 0a 0a 20 20 20 20 | | }.. |
|00005750| 20 20 20 20 2f 2a 20 61 | 74 74 65 6d 70 74 20 74 | /* a|ttempt t|
|00005760| 6f 20 66 69 6e 64 20 66 | 69 72 73 74 20 74 6f 6b |o find f|irst tok|
|00005770| 65 6e 20 61 73 20 61 20 | 70 72 6f 67 72 61 6d 20 |en as a |program |
|00005780| 6f 6e 20 74 68 65 20 70 | 61 74 68 20 2a 2f 0a 20 |on the p|ath */. |
|00005790| 20 20 20 20 20 20 20 70 | 61 72 73 65 5f 61 72 67 | p|arse_arg|
|000057a0| 73 28 63 6d 64 6c 6e 2c | 20 61 72 67 73 29 3b 0a |s(cmdln,| args);.|
|000057b0| 20 20 20 20 20 20 20 20 | 69 66 28 70 20 3d 20 70 | |if(p = p|
|000057c0| 66 69 6e 64 66 69 6c 65 | 28 61 72 67 73 5b 30 5d |findfile|(args[0]|
|000057d0| 2c 20 22 2e 74 74 70 5c | 30 2e 74 6f 73 5c 30 2e |, ".ttp\|0.tos\0.|
|000057e0| 70 72 67 5c 30 2e 61 70 | 70 22 29 29 0a 20 20 20 |prg\0.ap|p")). |
|000057f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 7b 0a 20 | | {. |
|00005800| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 66 | | f|
|00005810| 6f 72 6b 76 70 65 28 70 | 2c 20 61 72 67 73 2c 20 |orkvpe(p|, args, |
|00005820| 4e 55 4c 4c 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |NULL);. | |
|00005830| 20 20 20 20 20 20 20 77 | 61 69 74 28 26 72 76 29 | w|ait(&rv)|
|00005840| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00005850| 20 20 72 65 74 75 72 6e | 28 28 72 76 5b 31 5d 20 | return|((rv[1] |
|00005860| 3d 3d 20 30 29 20 3f 20 | 72 76 5b 30 5d 20 3a 20 |== 0) ? |rv[0] : |
|00005870| 72 76 5b 31 5d 29 3b 0a | 20 20 20 20 20 20 20 20 |rv[1]);.| |
|00005880| 20 20 20 20 20 20 20 20 | 7d 0a 20 20 20 20 20 20 | |}. |
|00005890| 20 20 72 65 74 75 72 6e | 28 45 52 52 4f 52 29 3b | return|(ERROR);|
|000058a0| 0a 7d 0a 2f 2a 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.}./*---|--------|
|000058b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000058c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000058d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000058e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2a 2f 0a 0a 49 |--------|---*/..I|
|000058f0| 20 68 6f 70 65 20 74 68 | 69 73 20 61 6e 73 77 65 | hope th|is answe|
|00005900| 72 73 20 79 6f 75 72 20 | 71 75 65 73 74 69 6f 6e |rs your |question|
|00005910| 2e 20 20 49 74 27 73 20 | 73 6f 20 65 61 73 79 20 |. It's |so easy |
|00005920| 66 6f 72 20 61 20 73 68 | 65 6c 6c 20 74 6f 20 69 |for a sh|ell to i|
|00005930| 6e 73 74 61 6c 6c 0a 69 | 74 73 65 6c 66 20 6f 6e |nstall.i|tself on|
|00005940| 20 74 68 65 20 73 68 65 | 6c 6c 5f 70 20 76 65 63 | the she|ll_p vec|
|00005950| 74 6f 72 20 61 6e 64 20 | 69 74 27 73 20 73 6f 20 |tor and |it's so |
|00005960| 63 6f 6e 76 65 6e 69 65 | 6e 74 20 69 66 20 6f 74 |convenie|nt if ot|
|00005970| 68 65 72 20 70 72 6f 67 | 72 61 6d 0a 77 68 69 63 |her prog|ram.whic|
|00005980| 68 20 73 75 70 70 6f 72 | 74 20 73 68 65 6c 6c 20 |h suppor|t shell |
|00005990| 65 73 63 61 70 65 73 20 | 75 73 65 20 61 20 73 79 |escapes |use a sy|
|000059a0| 73 74 65 6d 28 29 20 63 | 61 6c 6c 20 6c 69 6b 65 |stem() c|all like|
|000059b0| 20 74 68 65 20 6f 6e 65 | 20 61 62 6f 76 65 2e 0a | the one| above..|
|000059c0| 49 6e 20 63 61 73 65 20 | 74 68 65 72 65 20 69 73 |In case |there is|
|000059d0| 20 61 6e 79 20 71 75 65 | 73 74 69 6f 6e 20 61 62 | any que|stion ab|
|000059e0| 6f 75 74 20 69 6e 73 74 | 61 6c 6c 69 6e 67 20 61 |out inst|alling a|
|000059f0| 6e 64 20 72 65 6d 6f 76 | 69 6e 67 20 74 68 65 20 |nd remov|ing the |
|00005a00| 73 68 65 6c 6c 5f 70 0a | 76 65 63 74 6f 72 2c 20 |shell_p.|vector, |
|00005a10| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 72 6f |the foll|owing ro|
|00005a20| 75 74 69 6e 65 73 20 77 | 69 6c 6c 20 68 61 6e 64 |utines w|ill hand|
|00005a30| 6c 65 20 69 74 20 6e 69 | 63 65 6c 79 2e 0a 0a 2f |le it ni|cely.../|
|00005a40| 2a 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |*-------|--------|
|00005a50| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005a60| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005a70| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005a80| 2d 2d 2d 2d 2d 2d 2d 2a | 2f 0a 6c 6f 6e 67 20 28 |-------*|/.long (|
|00005a90| 2a 73 68 5f 73 61 76 65 | 29 28 29 3b 20 20 20 20 |*sh_save|)(); |
|00005aa0| 20 20 2f 2a 20 70 72 65 | 76 69 6f 75 73 20 76 61 | /* pre|vious va|
|00005ab0| 6c 75 65 20 6f 66 20 5f | 73 68 65 6c 6c 5f 70 20 |lue of _|shell_p |
|00005ac0| 76 61 72 69 61 62 6c 65 | 20 2a 2f 0a 0a 73 68 5f |variable| */..sh_|
|00005ad0| 69 6e 73 74 61 6c 6c 28 | 6e 65 77 5f 73 68 65 6c |install(|new_shel|
|00005ae0| 6c 29 0a 20 20 20 20 20 | 20 20 20 69 6e 74 20 28 |l). | int (|
|00005af0| 2a 6e 65 77 5f 73 68 65 | 6c 6c 29 28 29 3b 0a 2f |*new_she|ll)();./|
|00005b00| 2a 0a 20 2a 20 69 6e 73 | 74 61 6c 6c 20 5f 73 68 |*. * ins|tall _sh|
|00005b10| 65 6c 6c 5f 70 20 76 65 | 63 74 6f 72 0a 20 2a 2f |ell_p ve|ctor. */|
|00005b20| 0a 20 20 20 20 20 20 20 | 20 7b 0a 20 20 20 20 20 |. | {. |
|00005b30| 20 20 20 72 65 67 69 73 | 74 65 72 20 6c 6f 6e 67 | regis|ter long|
|00005b40| 20 2a 73 73 70 3b 0a 20 | 20 20 20 20 20 20 20 72 | *ssp;. | r|
|00005b50| 65 67 69 73 74 65 72 20 | 28 2a 2a 73 68 65 6c 6c |egister |(**shell|
|00005b60| 5f 70 29 28 29 20 3d 20 | 30 78 34 46 36 4c 3b 0a |_p)() = |0x4F6L;.|
|00005b70| 0a 20 20 20 20 20 20 20 | 20 73 73 70 20 3d 20 53 |. | ssp = S|
|00005b80| 75 70 65 72 28 30 4c 29 | 3b 0a 20 20 20 20 20 20 |uper(0L)|;. |
|00005b90| 20 20 73 68 5f 73 61 76 | 65 20 3d 20 2a 73 68 65 | sh_sav|e = *she|
|00005ba0| 6c 6c 5f 70 3b 0a 20 20 | 20 20 20 20 20 20 2a 73 |ll_p;. | *s|
|00005bb0| 68 65 6c 6c 5f 70 20 3d | 20 6e 65 77 5f 73 68 65 |hell_p =| new_she|
|00005bc0| 6c 6c 3b 0a 20 20 20 20 | 20 20 20 20 53 75 70 65 |ll;. | Supe|
|00005bd0| 72 28 73 73 70 29 3b 0a | 20 20 20 20 20 20 20 20 |r(ssp);.| |
|00005be0| 7d 0a 0a 73 68 5f 72 65 | 73 74 6f 72 65 28 29 0a |}..sh_re|store().|
|00005bf0| 2f 2a 0a 20 2a 20 72 65 | 73 74 6f 72 65 20 6f 6c |/*. * re|store ol|
|00005c00| 64 20 5f 73 68 65 6c 6c | 5f 70 20 76 65 63 74 6f |d _shell|_p vecto|
|00005c10| 72 0a 20 2a 2f 0a 20 20 | 20 20 20 20 20 20 7b 0a |r. */. | {.|
|00005c20| 20 20 20 20 20 20 20 20 | 72 65 67 69 73 74 65 72 | |register|
|00005c30| 20 6c 6f 6e 67 20 2a 73 | 73 70 3b 0a 20 20 20 20 | long *s|sp;. |
|00005c40| 20 20 20 20 72 65 67 69 | 73 74 65 72 20 28 2a 2a | regi|ster (**|
|00005c50| 73 68 65 6c 6c 5f 70 29 | 28 29 20 3d 20 30 78 34 |shell_p)|() = 0x4|
|00005c60| 46 36 4c 3b 0a 0a 20 20 | 20 20 20 20 20 20 73 73 |F6L;.. | ss|
|00005c70| 70 20 3d 20 53 75 70 65 | 72 28 30 4c 29 3b 0a 20 |p = Supe|r(0L);. |
|00005c80| 20 20 20 20 20 20 20 2a | 73 68 65 6c 6c 5f 70 20 | *|shell_p |
|00005c90| 3d 20 73 68 5f 73 61 76 | 65 3b 0a 20 20 20 20 20 |= sh_sav|e;. |
|00005ca0| 20 20 20 53 75 70 65 72 | 28 73 73 70 29 3b 0a 20 | Super|(ssp);. |
|00005cb0| 20 20 20 20 20 20 20 7d | 0a 2f 2a 2d 2d 2d 2d 2d | }|./*-----|
|00005cc0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005cd0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005ce0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005cf0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005d00| 2d 2a 2f 0a 0a 50 53 2e | 20 20 46 6f 72 20 74 68 |-*/..PS.| For th|
|00005d10| 6f 73 65 20 77 61 69 74 | 69 6e 67 20 66 6f 72 20 |ose wait|ing for |
|00005d20| 64 4c 69 62 73 20 76 31 | 2e 31 20 61 6e 64 2f 6f |dLibs v1|.1 and/o|
|00005d30| 72 20 4d 69 63 72 6f 45 | 4d 41 43 53 20 32 2e 31 |r MicroE|MACS 2.1|
|00005d40| 39 2c 20 49 20 68 61 76 | 65 0a 73 65 6e 74 20 6f |9, I hav|e.sent o|
|00005d50| 75 74 20 64 69 73 6b 73 | 20 66 6f 72 20 61 6c 6c |ut disks| for all|
|00005d60| 20 74 68 65 20 72 65 71 | 75 65 73 74 73 20 49 20 | the req|uests I |
|00005d70| 68 61 64 20 6f 75 74 73 | 74 61 6e 64 69 6e 67 2c |had outs|tanding,|
|00005d80| 20 79 6f 75 20 73 68 6f | 75 6c 64 20 65 69 74 68 | you sho|uld eith|
|00005d90| 65 72 0a 61 6c 72 65 61 | 64 79 20 68 61 76 65 20 |er.alrea|dy have |
|00005da0| 74 68 65 6d 2c 20 6f 72 | 20 73 68 6f 75 6c 64 20 |them, or| should |
|00005db0| 72 65 63 65 69 76 65 20 | 74 68 65 6d 20 73 6f 6f |receive |them soo|
|00005dc0| 6e 2e 20 20 53 6f 72 72 | 79 20 66 6f 72 20 74 68 |n. Sorr|y for th|
|00005dd0| 65 20 64 65 6c 61 79 73 | 2e 0a 49 20 68 6f 70 65 |e delays|..I hope|
|00005de0| 20 79 6f 75 27 72 65 20 | 68 61 70 70 79 20 77 69 | you're |happy wi|
|00005df0| 74 68 20 74 68 65 20 72 | 65 73 75 6c 74 73 2e 20 |th the r|esults. |
|00005e00| 20 49 27 64 20 6c 69 6b | 65 20 74 6f 20 68 65 61 | I'd lik|e to hea|
|00005e10| 72 20 66 72 6f 6d 20 73 | 6f 6d 65 20 6f 66 20 79 |r from s|ome of y|
|00005e20| 6f 75 0a 61 66 74 65 72 | 20 79 6f 75 27 76 65 20 |ou.after| you've |
|00005e30| 75 73 65 64 20 64 4c 69 | 62 73 20 61 20 62 69 74 |used dLi|bs a bit|
|00005e40| 2e 20 20 49 27 64 20 62 | 65 20 68 61 70 70 79 20 |. I'd b|e happy |
|00005e50| 74 6f 20 72 65 63 65 69 | 76 65 20 62 75 67 20 72 |to recei|ve bug r|
|00005e60| 65 70 6f 72 74 73 2c 0a | 73 75 67 67 65 73 74 65 |eports,.|suggeste|
|00005e70| 64 20 65 6e 68 61 6e 63 | 65 6d 65 6e 74 73 20 6f |d enhanc|ements o|
|00005e80| 72 20 6a 75 73 74 20 65 | 78 70 65 72 69 65 6e 63 |r just e|xperienc|
|00005e90| 65 73 20 73 6f 20 74 68 | 61 74 20 49 20 6b 6e 6f |es so th|at I kno|
|00005ea0| 77 20 74 68 65 79 27 72 | 65 20 62 65 69 6e 67 0a |w they'r|e being.|
|00005eb0| 70 75 74 20 74 6f 20 67 | 6f 6f 64 20 75 73 65 2e |put to g|ood use.|
|00005ec0| 0a 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00005ed0| 20 20 44 61 6c 65 20 53 | 63 68 75 6d 61 63 68 65 | Dale S|chumache|
|00005ee0| 72 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |r. | |
|00005ef0| 20 20 2e 2e 69 68 6e 70 | 34 21 6d 65 63 63 74 73 | ..ihnp|4!meccts|
|00005f00| 21 73 74 61 67 21 73 79 | 6e 74 65 6c 21 64 61 6c |!stag!sy|ntel!dal|
|00005f10| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00005f20| 20 28 61 6c 69 61 73 3a | 20 44 61 6c 6e 65 66 72 | (alias:| Dalnefr|
|00005f30| 65 27 29 0a 0a 41 72 74 | 69 63 6c 65 20 36 31 36 |e')..Art|icle 616|
|00005f40| 20 6f 66 20 63 6f 6d 70 | 2e 73 79 73 2e 61 74 61 | of comp|.sys.ata|
|00005f50| 72 69 2e 73 74 3a 0a 50 | 61 74 68 3a 0a 75 6e 69 |ri.st:.P|ath:.uni|
|00005f60| 64 6f 21 6d 63 76 61 78 | 21 75 75 6e 65 74 21 68 |do!mcvax|!uunet!h|
|00005f70| 75 73 63 36 21 62 6c 6f | 6f 6d 2d 62 65 61 63 6f |usc6!blo|om-beaco|
|00005f80| 6e 21 67 61 74 65 63 68 | 21 72 75 74 67 65 72 73 |n!gatech|!rutgers|
|00005f90| 21 75 77 76 61 78 21 75 | 6d 6e 2d 64 2d 75 62 21 |!uwvax!u|mn-d-ub!|
|00005fa0| 75 6d 6e 2d 63 0a 63 73 | 21 6d 6d 6d 21 65 6d 73 |umn-c.cs|!mmm!ems|
|00005fb0| 21 76 69 70 65 72 21 6a | 6f 68 6e 0a 3e 46 72 6f |!viper!j|ohn.>Fro|
|00005fc0| 6d 3a 20 6a 6f 68 6e 40 | 76 69 70 65 72 2e 4c 79 |m: john@|viper.Ly|
|00005fd0| 6e 78 2e 4d 4e 2e 4f 72 | 67 20 28 4a 6f 68 6e 20 |nx.MN.Or|g (John |
|00005fe0| 53 74 61 6e 6c 65 79 29 | 0a 4e 65 77 73 67 72 6f |Stanley)|.Newsgro|
|00005ff0| 75 70 73 3a 20 63 6f 6d | 70 2e 73 79 73 2e 61 74 |ups: com|p.sys.at|
|00006000| 61 72 69 2e 73 74 0a 53 | 75 62 6a 65 63 74 3a 20 |ari.st.S|ubject: |
|00006010| 52 65 3a 20 50 72 69 6e | 74 20 72 65 64 69 72 65 |Re: Prin|t redire|
|00006020| 63 74 69 6f 6e 20 72 6f | 75 74 69 6e 65 0a 4d 65 |ction ro|utine.Me|
|00006030| 73 73 61 67 65 2d 49 44 | 3a 20 3c 35 39 35 40 76 |ssage-ID|: <595@v|
|00006040| 69 70 65 72 2e 4c 79 6e | 78 2e 4d 4e 2e 4f 72 67 |iper.Lyn|x.MN.Org|
|00006050| 3e 0a 44 61 74 65 3a 20 | 38 20 46 65 62 20 38 38 |>.Date: |8 Feb 88|
|00006060| 20 30 39 3a 34 39 3a 33 | 38 20 47 4d 54 0a 41 72 | 09:49:3|8 GMT.Ar|
|00006070| 74 69 63 6c 65 2d 49 2e | 44 2e 3a 20 76 69 70 65 |ticle-I.|D.: vipe|
|00006080| 72 2e 35 39 35 0a 50 6f | 73 74 65 64 3a 20 4d 6f |r.595.Po|sted: Mo|
|00006090| 6e 20 46 65 62 20 20 38 | 20 31 30 3a 34 39 3a 33 |n Feb 8| 10:49:3|
|000060a0| 38 20 31 39 38 38 0a 52 | 65 66 65 72 65 6e 63 65 |8 1988.R|eference|
|000060b0| 73 3a 20 3c 38 38 30 31 | 32 37 31 33 31 33 2e 41 |s: <8801|271313.A|
|000060c0| 41 31 30 37 35 30 40 6c | 61 73 73 6f 2e 6c 61 61 |A10750@l|asso.laa|
|000060d0| 73 2e 66 72 3e 20 3c 31 | 35 40 6f 62 69 65 2e 55 |s.fr> <1|5@obie.U|
|000060e0| 55 43 50 3e 0a 52 65 70 | 6c 79 2d 54 6f 3a 20 6a |UCP>.Rep|ly-To: j|
|000060f0| 6f 68 6e 40 76 69 70 65 | 72 2e 55 55 43 50 20 28 |ohn@vipe|r.UUCP (|
|00006100| 4a 6f 68 6e 20 53 74 61 | 6e 6c 65 79 29 0a 4f 72 |John Sta|nley).Or|
|00006110| 67 61 6e 69 7a 61 74 69 | 6f 6e 3a 20 44 79 6e 61 |ganizati|on: Dyna|
|00006120| 53 6f 66 74 20 53 79 73 | 74 65 6d 73 0a 4c 69 6e |Soft Sys|tems.Lin|
|00006130| 65 73 3a 20 35 34 0a 0a | 0a 20 3e 49 6e 20 61 72 |es: 54..|. >In ar|
|00006140| 74 69 63 6c 65 20 3c 38 | 38 30 31 32 37 31 33 31 |ticle <8|80127131|
|00006150| 33 2e 41 41 31 30 37 35 | 30 40 6c 61 73 73 6f 2e |3.AA1075|0@lasso.|
|00006160| 6c 61 61 73 2e 66 72 3e | 2c 20 0a 20 3e 72 61 6c |laas.fr>|, . >ral|
|00006170| 70 68 40 6c 61 73 73 6f | 2e 55 55 43 50 20 28 52 |ph@lasso|.UUCP (R|
|00006180| 61 6c 70 68 20 50 2e 20 | 53 6f 62 65 6b 29 20 77 |alph P. |Sobek) w|
|00006190| 72 69 74 65 73 3a 0a 20 | 3e 3e 20 54 6f 3a 20 69 |rites:. |>> To: i|
|000061a0| 6e 72 69 61 21 73 63 6f | 72 65 2e 73 74 61 6e 66 |nria!sco|re.stanf|
|000061b0| 6f 72 64 2e 65 64 75 21 | 69 6e 66 6f 2d 61 74 61 |ord.edu!|info-ata|
|000061c0| 72 69 31 36 0a 20 3e 3e | 20 53 75 62 6a 65 63 74 |ri16. >>| Subject|
|000061d0| 3a 20 50 72 69 6e 74 20 | 72 65 64 69 72 65 63 74 |: Print |redirect|
|000061e0| 69 6f 6e 20 72 6f 75 74 | 69 6e 65 0a 20 3e 3e 20 |ion rout|ine. >> |
|000061f0| 0a 20 3e 3e 20 77 68 61 | 74 20 49 27 6d 20 6c 6f |. >> wha|t I'm lo|
|00006200| 6f 6b 69 6e 67 20 66 6f | 72 20 69 73 20 61 6e 20 |oking fo|r is an |
|00006210| 61 73 73 65 6d 62 6c 65 | 72 20 6f 72 20 43 20 70 |assemble|r or C p|
|00006220| 72 6f 67 72 61 6d 20 77 | 68 69 63 68 20 77 6f 75 |rogram w|hich wou|
|00006230| 6c 64 20 72 65 64 69 72 | 65 63 74 0a 20 3e 3e 20 |ld redir|ect. >> |
|00006240| 74 68 65 20 6f 75 74 70 | 75 74 20 6f 66 20 6f 6e |the outp|ut of on|
|00006250| 65 20 6f 66 20 74 68 65 | 73 65 20 70 72 6f 67 72 |e of the|se progr|
|00006260| 61 6d 73 20 74 6f 20 61 | 6e 20 61 73 63 69 69 20 |ams to a|n ascii |
|00006270| 66 69 6c 65 20 72 61 74 | 68 65 72 20 74 68 61 6e |file rat|her than|
|00006280| 20 74 68 65 0a 70 72 69 | 6e 74 65 72 2e 0a 0a 20 | the.pri|nter... |
|00006290| 20 20 54 68 65 20 62 65 | 73 74 20 70 72 6f 67 72 | The be|st progr|
|000062a0| 61 6d 20 74 6f 20 61 63 | 63 6f 6d 70 6c 69 73 68 |am to ac|complish|
|000062b0| 20 74 68 69 73 20 69 73 | 20 63 61 6c 6c 65 64 20 | this is| called |
|000062c0| 62 61 72 72 65 6c 20 77 | 72 69 74 74 65 6e 20 62 |barrel w|ritten b|
|000062d0| 79 0a 4d 6f 73 68 65 20 | 42 72 61 6e 65 72 2e 20 |y.Moshe |Braner. |
|000062e0| 20 49 74 20 68 61 73 20 | 73 65 76 65 72 61 6c 20 | It has |several |
|000062f0| 66 75 6e 63 74 69 6f 6e | 73 20 74 6f 20 61 6c 6c |function|s to all|
|00006300| 6f 77 20 63 61 70 74 75 | 72 69 6e 67 20 74 65 78 |ow captu|ring tex|
|00006310| 74 20 6f 72 0a 73 63 72 | 65 65 6e 20 64 75 6d 70 |t or.scr|een dump|
|00006320| 73 20 74 6f 20 61 20 66 | 69 6c 65 2e 20 20 49 74 |s to a f|ile. It|
|00006330| 20 69 73 20 54 53 52 20 | 28 74 65 72 6d 69 6e 61 | is TSR |(termina|
|00006340| 74 65 20 26 20 73 74 61 | 79 20 72 65 73 69 64 65 |te & sta|y reside|
|00006350| 6e 74 29 20 77 68 69 63 | 68 0a 6d 61 79 20 6f 72 |nt) whic|h.may or|
|00006360| 20 6d 61 79 20 6e 6f 74 | 20 62 65 20 77 68 61 74 | may not| be what|
|00006370| 20 79 6f 75 20 6f 72 69 | 67 69 6e 61 6c 79 20 77 | you ori|ginaly w|
|00006380| 61 6e 74 65 64 2c 20 62 | 75 74 20 69 74 20 69 73 |anted, b|ut it is|
|00006390| 20 67 6f 6f 64 20 61 6e | 64 20 69 74 0a 77 6f 72 | good an|d it.wor|
|000063a0| 6b 73 2e 2e 2e 2e 0a 0a | 0a 49 6e 20 61 72 74 69 |ks......|.In arti|
|000063b0| 63 6c 65 20 3c 31 35 40 | 6f 62 69 65 2e 55 55 43 |cle <15@|obie.UUC|
|000063c0| 50 3e 20 77 65 73 40 6f | 62 69 65 2e 55 55 43 50 |P> wes@o|bie.UUCP|
|000063d0| 20 28 42 61 72 6e 61 63 | 6c 65 20 57 65 73 29 20 | (Barnac|le Wes) |
|000063e0| 77 72 69 74 65 73 3a 0a | 20 3e 59 6f 75 20 63 61 |writes:.| >You ca|
|000063f0| 6e 20 72 65 64 69 72 65 | 63 74 20 74 68 65 20 6f |n redire|ct the o|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.